MCPcopy Create free account
hub / github.com/basecamp/hey-cli / TestToTextStripsScript

Function TestToTextStripsScript

internal/htmlutil/htmlutil_test.go:46–51  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

44}
45
46func TestToTextStripsScript(t *testing.T) {
47 got := ToText("<p>hello</p><script>alert('xss')</script>")
48 if strings.Contains(got, "alert") {
49 t.Errorf("ToText should strip script content, got %q", got)
50 }
51}
52
53func TestToTextEmpty(t *testing.T) {
54 got := ToText("")

Callers

nothing calls this directly

Calls 1

ToTextFunction · 0.85

Tested by

no test coverage detected