(t *testing.T)
| 12 | const esc = "\x1b" |
| 13 | |
| 14 | func TestUntrusted_String_sanitizes(t *testing.T) { |
| 15 | u := NewUntrusted("hello" + esc + "[31mRED" + esc + "[0m") |
| 16 | assert.NotContains(t, u.String(), esc) |
| 17 | } |
| 18 | |
| 19 | // The property that drove the design: fmt reflection must not leak the raw |
| 20 | // bytes through any verb. Because Untrusted implements Stringer, %s, %v, and the |
nothing calls this directly
no test coverage detected