helpers: Add BenchmarkTrimShortHTML
This commit is contained in:
parent
00ae8e8c72
commit
bfc3122f8e
1 changed files with 8 additions and 0 deletions
|
@ -50,6 +50,14 @@ func TestTrimShortHTML(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func BenchmarkTrimShortHTML(b *testing.B) {
|
||||||
|
c := newTestContentSpec(nil)
|
||||||
|
b.ResetTimer()
|
||||||
|
for i := 0; i < b.N; i++ {
|
||||||
|
c.TrimShortHTML([]byte("<p>Simple paragraph</p>"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestBytesToHTML(t *testing.T) {
|
func TestBytesToHTML(t *testing.T) {
|
||||||
c := qt.New(t)
|
c := qt.New(t)
|
||||||
c.Assert(helpers.BytesToHTML([]byte("dobedobedo")), qt.Equals, template.HTML("dobedobedo"))
|
c.Assert(helpers.BytesToHTML([]byte("dobedobedo")), qt.Equals, template.HTML("dobedobedo"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue