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

Function TestCmdListTasksFormatJSONDueRaw

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

Source from the content-addressed store, hash-verified

790}
791
792func TestCmdListTasksFormatJSONDueRaw(t *testing.T) {
793 root, db := showListEditDB(t)
794 insertTask(t, db, "due-t", "Has Due", "backlog", "high", filepath.Join(root, "x"), nil)
795 if _, err := db.Exec(`UPDATE tasks SET due_date = ? WHERE slug = ?`, "2026-12-31", "due-t"); err != nil {
796 t.Fatal(err)
797 }
798 out := captureStdout(t, func() {
799 if rc := cmdList([]string{"tasks", "--format", "json"}); rc != 0 {
800 t.Fatalf("rc=%d", rc)
801 }
802 })
803 var rows []taskListRow
804 if err := json.Unmarshal([]byte(out), &rows); err != nil {
805 t.Fatalf("invalid JSON: %v\nout=%q", err, out)
806 }
807 if len(rows) != 1 || rows[0].Due != "2026-12-31" {
808 t.Fatalf("want raw due 2026-12-31, got %+v", rows)
809 }
810}
811
812// TestCmdListTasksAutoColumn: `flow list tasks` has a dedicated, always-on
813// AUTO column. A running run shows "running <pid>"; terminal runs show the

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