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

Function TestCmdShowTaskOverdue

internal/app/show_test.go:427–443  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

425}
426
427func 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
445func TestCmdShowTaskTemporalSummary(t *testing.T) {
446 root, db := showListEditDB(t)

Callers

nothing calls this directly

Calls 4

showListEditDBFunction · 0.85
captureStdoutFunction · 0.85
cmdShowFunction · 0.85
insertTaskFunction · 0.70

Tested by

no test coverage detected