Skip to content

Commit 7dec81f

Browse files
authored
Merge pull request #150 from naggie/fix_ordering
Restore original ordering
2 parents fbe1d6a + beb36f6 commit 7dec81f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

display.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515

1616
// DisplayByNext renders the TaskSet's array of tasks.
1717
func (ts *TaskSet) DisplayByNext(ctx Query, truncate bool) error {
18-
ts.SortByCreated(Descending)
19-
ts.SortByPriority(Ascending)
18+
ts.SortByCreated(Ascending) // older tasks first (from top) like a FIFO queue
19+
ts.SortByPriority(Ascending) // high priority tasks first, of course
2020
if StdoutIsTTY() {
2121
ctx.PrintContextDescription()
2222
err := ts.renderTable(truncate)

integration/modify_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ func TestModifyTasksByID(t *testing.T) {
2929
assertProgramResult(t, output, exiterr, success)
3030

3131
tasks := unmarshalTaskArray(t, output)
32-
assert.ElementsMatch(t, []string{"three", "extra"}, tasks[0].Tags, "extra tag added to task three")
32+
assert.ElementsMatch(t, []string{"three", "extra"}, tasks[2].Tags, "extra tag added to task three")
3333
assert.ElementsMatch(t, []string{"two", "extra"}, tasks[1].Tags, "extra tag added to task two")
34-
assert.ElementsMatch(t, []string{"one"}, tasks[2].Tags, "task 1 not modified")
34+
assert.ElementsMatch(t, []string{"one"}, tasks[0].Tags, "task 1 not modified")
3535
}
3636

3737
func TestModifyTasksInContext(t *testing.T) {

integration/show_open_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ func TestShowOpen(t *testing.T) {
2424

2525
var tasks []dstask.Task
2626

27-
// Newest tasks come first
27+
// Oldest tasks come first
2828
tasks = unmarshalTaskArray(t, output)
29-
assert.Equal(t, "two", tasks[0].Summary, "two should be sorted first")
29+
assert.Equal(t, "two", tasks[1].Summary, "two should be sorted last")
3030

3131
output, exiterr, success = program("context", "-one")
3232
assertProgramResult(t, output, exiterr, success)

0 commit comments

Comments
 (0)