(t *testing.T)
| 44 | } |
| 45 | |
| 46 | func TestWriteDailyNote(t *testing.T) { |
| 47 | dir := t.TempDir() |
| 48 | ms := NewMemoryStore(dir, testLogger()) |
| 49 | |
| 50 | if err := ms.WriteDailyNote("Test entry"); err != nil { |
| 51 | t.Fatalf("write daily note failed: %v", err) |
| 52 | } |
| 53 | |
| 54 | path := ms.TodayNotePath() |
| 55 | data, err := os.ReadFile(path) |
| 56 | if err != nil { |
| 57 | t.Fatalf("failed to read daily note: %v", err) |
| 58 | } |
| 59 | if !strings.Contains(string(data), "Test entry") { |
| 60 | t.Error("expected 'Test entry' in daily note") |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | func TestTodayNotePath(t *testing.T) { |
| 65 | dir := t.TempDir() |
nothing calls this directly
no test coverage detected