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

Function TestRenderMarkdown_NoSentinelLeak

cli/cli_rendering_test.go:136–144  ·  view source on GitHub ↗

TestRenderMarkdown_NoSentinelLeak ensures the chip sentinel never leaks into rendered output.

(t *testing.T)

Source from the content-addressed store, hash-verified

134// TestRenderMarkdown_NoSentinelLeak ensures the chip sentinel never leaks into
135// rendered output.
136func 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
146func TestRenderMarkdown_ThemedAndPreservesCodeIndent(t *testing.T) {
147 t.Cleanup(func() { _ = theme.SetActive("dark"); theme.SetProfile(theme.DetectProfile()) })

Callers

nothing calls this directly

Calls 6

SetActiveFunction · 0.92
SetProfileFunction · 0.92
DetectProfileFunction · 0.92
stripANSIForTestFunction · 0.85
renderMarkdownMethod · 0.80
CleanupMethod · 0.45

Tested by

no test coverage detected