diff --git a/helpers/url_test.go b/helpers/url_test.go index 787cdd6e851..bb7f6eed747 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) + } +}