summaryrefslogtreecommitdiffstats
path: root/tpl/strings
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-03-01 17:51:09 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-03-01 17:51:09 +0100
commit079d1b65406a3ad6d6006f7f2be253e1d675e2e0 (patch)
treef9164c4769673f483cfb663f183ea1d0b4e9691e /tpl/strings
parenta56b9071db2991a4f4e882ecb57e3fc068b02be1 (diff)
tpl/strings: Add BenchmarkTruncate
Diffstat (limited to 'tpl/strings')
-rw-r--r--tpl/strings/truncate_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/tpl/strings/truncate_test.go b/tpl/strings/truncate_test.go
index f7d5d132d..95ca31162 100644
--- a/tpl/strings/truncate_test.go
+++ b/tpl/strings/truncate_test.go
@@ -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>")
+ }
+}