mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
tpl/strings: Add BenchmarkTruncate
This commit is contained in:
@@ -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>")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user