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

Function writeDailyNoteAt

cli/workspace/memory/rollup_test.go:15–29  ·  view source on GitHub ↗

writeDailyNoteAt fabricates a daily note file for a past date, in the same YYYYMM/YYYYMMDD.md layout DailyNoteStore uses. Synthetic content only.

(t *testing.T, dir string, date time.Time, bullets ...string)

Source from the content-addressed store, hash-verified

13// writeDailyNoteAt fabricates a daily note file for a past date, in the same
14// YYYYMM/YYYYMMDD.md layout DailyNoteStore uses. Synthetic content only.
15func writeDailyNoteAt(t *testing.T, dir string, date time.Time, bullets ...string) {
16 t.Helper()
17 monthDir := filepath.Join(dir, date.Format("200601"))
18 if err := os.MkdirAll(monthDir, 0o750); err != nil {
19 t.Fatal(err)
20 }
21 var sb strings.Builder
22 sb.WriteString("## 10:00\n\n")
23 for _, b := range bullets {
24 sb.WriteString("- " + b + "\n")
25 }
26 if err := os.WriteFile(filepath.Join(monthDir, date.Format("20060102")+".md"), []byte(sb.String()), 0o600); err != nil {
27 t.Fatal(err)
28 }
29}
30
31func TestRollup_WeeklyAndMonthlyDeterministic(t *testing.T) {
32 dir := t.TempDir()

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected