mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
Adding benchmark for transformation module.
This commit is contained in:
@@ -16,7 +16,7 @@ func TestChainZeroTransformers(t *testing.T) {
|
||||
|
||||
func TestChainOneTransformer(t *testing.T) {
|
||||
tr := NewChain(&AbsURL{BaseURL: "http://base"})
|
||||
apply(t, tr, abs_url_tests)
|
||||
apply(t.Errorf, tr, abs_url_tests)
|
||||
}
|
||||
|
||||
const H5_JS_CONTENT_ABS_URL_WITH_NAV = "<!DOCTYPE html><html><head><script src=\"/foobar.js\"></script></head><body><nav><ul><li hugo-nav=\"section_0\"></li><li hugo-nav=\"section_1\"></li></ul></nav><article>content <a href=\"/foobar\">foobar</a>. Follow up</article></body></html>"
|
||||
@@ -32,5 +32,16 @@ func TestChainTwoTransformer(t *testing.T) {
|
||||
&AbsURL{BaseURL: "http://two"},
|
||||
&NavActive{Section: "section_1"},
|
||||
)
|
||||
apply(t, tr, two_chain_tests)
|
||||
apply(t.Errorf, tr, two_chain_tests)
|
||||
}
|
||||
|
||||
func BenchmarkChain(b *testing.B) {
|
||||
|
||||
tr := NewChain(
|
||||
&AbsURL{BaseURL: "http://two"},
|
||||
&NavActive{Section: "section_1"},
|
||||
)
|
||||
for i := 0; i < b.N; i++ {
|
||||
apply(b.Errorf, tr, two_chain_tests)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user