mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-29 23:20:49 +03: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")
|
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…
Add table
Add a link
Reference in a new issue