Add BenchmarkAbsURL

This commit is contained in:
Bjørn Erik Pedersen 2023-06-12 15:15:28 +02:00
parent e1d43021ca
commit ded6866001
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -276,3 +276,13 @@ func BenchmarkRelURL(b *testing.B) {
_ = p.RelURL("https://base/foo/bar", false) _ = p.RelURL("https://base/foo/bar", false)
} }
} }
func BenchmarkAbsURL(b *testing.B) {
v := config.New()
v.Set("baseURL", "http://base/")
p := newTestPathSpecFromCfgAndLang(v, "")
b.ResetTimer()
for i := 0; i < b.N; i++ {
_ = p.AbsURL("foo/bar", false)
}
}