package seaglass_test import ( "slices" "strings" "testing" "git.golem15.com/golem15/summercms/modules/seaglass" ) // TestSeaglassSmoke checks the two promises of the sanitizer: clean HTML // comes back byte for byte with an empty report, and unsafe constructs are // removed and named. func TestSeaglassSmoke(t *testing.T) { clean := "
Mushrooms can help:
\nIt's "fine"
` if got := seaglass.Sanitize(quoted); got != quoted { t.Fatalf("re-escaped text changed: %q", got) } dirty := `Hi there
` got, report = seaglass.SanitizeReport(dirty) for _, bad := range []string{"onclick", "javascript", "