mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
tpl/strings: Add BenchmarkTruncate
This commit is contained in:
parent
a56b9071db
commit
079d1b6540
1 changed files with 6 additions and 0 deletions
|
@ -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>")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue