(t *testing.T)
| 35 | } |
| 36 | |
| 37 | func TestRender(t *testing.T) { |
| 38 | out := renderToString(t, sampleSessionJSONL, false) |
| 39 | |
| 40 | checks := []struct { |
| 41 | label string |
| 42 | contains string |
| 43 | }{ |
| 44 | {"user message", "─── User ───"}, |
| 45 | {"user text", "Hello, can you help me?"}, |
| 46 | {"thinking", "─── Thinking ───"}, |
| 47 | {"thinking text", "The user wants help."}, |
| 48 | {"assistant text", "Sure, let me check."}, |
| 49 | {"tool use bash", "─── Tool: Bash ───"}, |
| 50 | {"bash command", "$ echo hello"}, |
| 51 | {"tool result", "─── Result ───"}, |
| 52 | {"result content", "hello"}, |
| 53 | {"tool use read", "─── Tool: Read ───"}, |
| 54 | {"read path", "/tmp/test.go"}, |
| 55 | {"read offset", "offset=10"}, |
| 56 | {"read limit", "limit=20"}, |
| 57 | {"final text", "Done!"}, |
| 58 | } |
| 59 | for _, c := range checks { |
| 60 | if !strings.Contains(out, c.contains) { |
| 61 | t.Errorf("%s: output missing %q", c.label, c.contains) |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | // Skipped types don't leak. |
| 66 | if strings.Contains(out, "permission-mode") { |
| 67 | t.Error("permission-mode record leaked into output") |
| 68 | } |
| 69 | if strings.Contains(out, "file-history-snapshot") { |
| 70 | t.Error("file-history-snapshot record leaked into output") |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | func TestRenderCompact(t *testing.T) { |
| 75 | out := renderToString(t, sampleSessionJSONL, true) |
nothing calls this directly
no test coverage detected