diff options
Diffstat (limited to 'helpers/content_test.go')
-rw-r--r-- | helpers/content_test.go | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/helpers/content_test.go b/helpers/content_test.go index 4b67b44f0..54b7ef3f9 100644 --- a/helpers/content_test.go +++ b/helpers/content_test.go @@ -52,44 +52,6 @@ func TestTrimShortHTML(t *testing.T) { } } -func TestStripHTML(t *testing.T) { - type test struct { - input, expected string - } - data := []test{ - {"<h1>strip h1 tag <h1>", "strip h1 tag "}, - {"<p> strip p tag </p>", " strip p tag "}, - {"</br> strip br<br>", " strip br\n"}, - {"</br> strip br2<br />", " strip br2\n"}, - {"This <strong>is</strong> a\nnewline", "This is a newline"}, - {"No Tags", "No Tags"}, - {`<p>Summary Next Line. -<figure > - - <img src="/not/real" /> - - -</figure> -. -More text here.</p> - -<p>Some more text</p>`, "Summary Next Line. . More text here.\nSome more text\n"}, - } - for i, d := range data { - output := StripHTML(d.input) - if d.expected != output { - t.Errorf("Test %d failed. Expected %q got %q", i, d.expected, output) - } - } -} - -func BenchmarkStripHTML(b *testing.B) { - b.ResetTimer() - for i := 0; i < b.N; i++ { - StripHTML(tstHTMLContent) - } -} - func TestStripEmptyNav(t *testing.T) { c := qt.New(t) cleaned := stripEmptyNav([]byte("do<nav>\n</nav>\n\nbedobedo")) |