(t *testing.T)
| 425 | } |
| 426 | |
| 427 | func TestCmdShowTaskOverdue(t *testing.T) { |
| 428 | root, db := showListEditDB(t) |
| 429 | insertTask(t, db, "late", "Late", "in-progress", "high", filepath.Join(root, "x"), nil) |
| 430 | // Set due date to 3 days ago. |
| 431 | due := time.Now().AddDate(0, 0, -3).Format("2006-01-02") |
| 432 | if _, err := db.Exec(`UPDATE tasks SET due_date = ? WHERE slug = ?`, due, "late"); err != nil { |
| 433 | t.Fatal(err) |
| 434 | } |
| 435 | out := captureStdout(t, func() { |
| 436 | if rc := cmdShow([]string{"task", "late"}); rc != 0 { |
| 437 | t.Errorf("rc=%d", rc) |
| 438 | } |
| 439 | }) |
| 440 | if !strings.Contains(out, "overdue by 3 days") { |
| 441 | t.Errorf("missing overdue info; out=%q", out) |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | func TestCmdShowTaskTemporalSummary(t *testing.T) { |
| 446 | root, db := showListEditDB(t) |
nothing calls this directly
no test coverage detected