TestRenderMarkdown_NoSentinelLeak ensures the chip sentinel never leaks into rendered output.
(t *testing.T)
| 134 | // TestRenderMarkdown_NoSentinelLeak ensures the chip sentinel never leaks into |
| 135 | // rendered output. |
| 136 | func TestRenderMarkdown_NoSentinelLeak(t *testing.T) { |
| 137 | t.Cleanup(func() { _ = theme.SetActive("dark"); theme.SetProfile(theme.DetectProfile()) }) |
| 138 | theme.SetProfile(theme.ProfileTrueColor) |
| 139 | |
| 140 | md := "txt\n\n```go\nfunc main(){}\n```\n" |
| 141 | out := (&ChatCLI{}).renderMarkdown(md) |
| 142 | assert.NotContains(t, out, "clichip", "sentinel must be fully replaced") |
| 143 | assert.Contains(t, stripANSIForTest(out), "▌ go", "language chip is rendered") |
| 144 | } |
| 145 | |
| 146 | func TestRenderMarkdown_ThemedAndPreservesCodeIndent(t *testing.T) { |
| 147 | t.Cleanup(func() { _ = theme.SetActive("dark"); theme.SetProfile(theme.DetectProfile()) }) |
nothing calls this directly
no test coverage detected