MCPcopy Create free account
hub / github.com/diillson/chatcli / TestWriteDailyNote

Function TestWriteDailyNote

cli/workspace/memory_test.go:46–62  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

44}
45
46func 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
64func TestTodayNotePath(t *testing.T) {
65 dir := t.TempDir()

Callers

nothing calls this directly

Calls 5

WriteDailyNoteMethod · 0.95
TodayNotePathMethod · 0.95
NewMemoryStoreFunction · 0.70
testLoggerFunction · 0.70
ErrorMethod · 0.65

Tested by

no test coverage detected