(t *testing.T)
| 88 | } |
| 89 | |
| 90 | func TestPushDrainMemoryNotices(t *testing.T) { |
| 91 | cli := &ChatCLI{} |
| 92 | cli.pushMemoryNotice("") // empty is ignored |
| 93 | cli.pushMemoryNotice("memory: +1 fact") |
| 94 | cli.memNoticeMu.Lock() |
| 95 | n := len(cli.memNotices) |
| 96 | cli.memNoticeMu.Unlock() |
| 97 | if n != 1 { |
| 98 | t.Fatalf("expected 1 queued notice, got %d", n) |
| 99 | } |
| 100 | cli.drainMemoryNotices() // prints + clears |
| 101 | cli.memNoticeMu.Lock() |
| 102 | n = len(cli.memNotices) |
| 103 | cli.memNoticeMu.Unlock() |
| 104 | if n != 0 { |
| 105 | t.Errorf("expected notices drained, got %d", n) |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | func TestSnippetAroundHelper(t *testing.T) { |
| 110 | // Reuse the session snippet helper to ensure it stays covered/working. |
nothing calls this directly
no test coverage detected