tpl/strings: Add BenchmarkTruncate

This commit is contained in:
Bjørn Erik Pedersen 2023-03-01 17:51:09 +01:00
parent a56b9071db
commit 079d1b6540
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -81,3 +81,9 @@ func TestTruncate(t *testing.T) {
t.Errorf("Should have errored")
}
}
func BenchmarkTruncate(b *testing.B) {
for i := 0; i < b.N; i++ {
ns.Truncate(10, "<p>test <b>hello</b> test something</p>")
}
}