From 13f7678a9fd092ac20eec10e4d2196f5bd1ae107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20B=C3=BCtow?= <1224732+snonux@users.noreply.github.com> Date: Fri, 20 Jun 2025 09:40:56 +0300 Subject: Add cell navigation, editor hotkey, stats and filter --- internal/task/stats_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 internal/task/stats_test.go (limited to 'internal/task/stats_test.go') diff --git a/internal/task/stats_test.go b/internal/task/stats_test.go new file mode 100644 index 0000000..fddbd69 --- /dev/null +++ b/internal/task/stats_test.go @@ -0,0 +1,28 @@ +package task + +import ( + "testing" + "time" +) + +func TestStats(t *testing.T) { + now := time.Now() + tasks := []Task{ + {Description: "t1"}, + {Description: "t2", Start: "20240101T000000Z"}, + {Description: "t3", Due: now.Add(-time.Hour).Format("20060102T150405Z")}, + {Description: "t4", Start: "20240101T000000Z", Due: now.Add(-time.Hour).Format("20060102T150405Z")}, + } + + if TotalTasks(tasks) != 4 { + t.Errorf("total tasks wrong: %d", TotalTasks(tasks)) + } + + if InProgressTasks(tasks) != 2 { + t.Errorf("in progress wrong: %d", InProgressTasks(tasks)) + } + + if DueTasks(tasks, now) != 2 { + t.Errorf("due tasks wrong: %d", DueTasks(tasks, now)) + } +} -- cgit v1.2.3