(t *testing.T)
| 790 | } |
| 791 | |
| 792 | func 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 |
nothing calls this directly
no test coverage detected