MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / forcePlainColor

Function forcePlainColor

internal/cli/format_test.go:15–20  ·  view source on GitHub ↗

forcePlainColor disables ANSI so width/content assertions are deterministic regardless of whether the test binary's stdout happens to be a TTY.

(t *testing.T)

Source from the content-addressed store, hash-verified

13// forcePlainColor disables ANSI so width/content assertions are deterministic
14// regardless of whether the test binary's stdout happens to be a TTY.
15func forcePlainColor(t *testing.T) {
16 t.Helper()
17 prev := color.NoColor
18 color.NoColor = true
19 t.Cleanup(func() { color.NoColor = prev })
20}
21
22func TestDisplayWidth_StripsANSIAndCountsRunes(t *testing.T) {
23 // A literal SGR-wrapped string must measure the same as its plain form.

Calls

no outgoing calls

Tested by

no test coverage detected