MCPcopy Create free account
hub / github.com/Facets-cloud/flow / TestCmdListTasksPrioritySort

Function TestCmdListTasksPrioritySort

internal/app/list_test.go:46–66  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

44}
45
46func TestCmdListTasksPrioritySort(t *testing.T) {
47 root, db := showListEditDB(t)
48 insertTask(t, db, "c-low", "c", "backlog", "low", filepath.Join(root, "x"), nil)
49 insertTask(t, db, "a-high", "a", "backlog", "high", filepath.Join(root, "x"), nil)
50 insertTask(t, db, "b-med", "b", "backlog", "medium", filepath.Join(root, "x"), nil)
51
52 out := captureStdout(t, func() {
53 if rc := cmdList([]string{"tasks"}); rc != 0 {
54 t.Errorf("rc=%d", rc)
55 }
56 })
57 ih := strings.Index(out, "a-high")
58 im := strings.Index(out, "b-med")
59 il := strings.Index(out, "c-low")
60 if ih < 0 || im < 0 || il < 0 {
61 t.Fatalf("missing rows; out=%q", out)
62 }
63 if !(ih < im && im < il) {
64 t.Errorf("priority order wrong: high=%d, med=%d, low=%d", ih, im, il)
65 }
66}
67
68func TestCmdListTasksStaleMarker(t *testing.T) {
69 root, db := showListEditDB(t)

Callers

nothing calls this directly

Calls 4

showListEditDBFunction · 0.85
captureStdoutFunction · 0.85
cmdListFunction · 0.85
insertTaskFunction · 0.70

Tested by

no test coverage detected