helpers: Add BenchmarkTrimShortHTML

This commit is contained in:
Bjørn Erik Pedersen 2024-04-14 15:54:49 +02:00
parent 00ae8e8c72
commit bfc3122f8e
No known key found for this signature in database

View file

@ -50,6 +50,14 @@ func TestTrimShortHTML(t *testing.T) {
}
}
func BenchmarkTrimShortHTML(b *testing.B) {
c := newTestContentSpec(nil)
b.ResetTimer()
for i := 0; i < b.N; i++ {
c.TrimShortHTML([]byte("<p>Simple paragraph</p>"))
}
}
func TestBytesToHTML(t *testing.T) {
c := qt.New(t)
c.Assert(helpers.BytesToHTML([]byte("dobedobedo")), qt.Equals, template.HTML("dobedobedo"))