Skip to content

Commit

Permalink
helpers: Add BenchmarkTrimShortHTML
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Apr 14, 2024
1 parent 00ae8e8 commit bfc3122
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions helpers/content_test.go
Expand Up @@ -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"))
Expand Down

0 comments on commit bfc3122

Please sign in to comment.