summaryrefslogtreecommitdiffstats
path: root/helpers/url_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/url_test.go')
-rw-r--r--helpers/url_test.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/helpers/url_test.go b/helpers/url_test.go
index 787cdd6e8..bb7f6eed7 100644
--- a/helpers/url_test.go
+++ b/helpers/url_test.go
@@ -149,7 +149,7 @@ func TestRelURL(t *testing.T) {
}
}
-func doTestRelURL(t *testing.T, defaultInSubDir, addLanguage, multilingual bool, lang string) {
+func doTestRelURL(t testing.TB, defaultInSubDir, addLanguage, multilingual bool, lang string) {
t.Helper()
c := qt.New(t)
v := config.New()
@@ -262,3 +262,13 @@ func TestSanitizeURL(t *testing.T) {
}
}
}
+
+func BenchmarkRelURL(b *testing.B) {
+ v := config.New()
+ v.Set("baseURL", "http://base/")
+ p := newTestPathSpecFromCfgAndLang(v, "")
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _ = p.RelURL("https://base/foo/bar", false)
+ }
+}