summaryrefslogtreecommitdiffstats
path: root/helpers/url_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-09-13 21:37:27 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-09-13 21:37:27 +0200
commitf53145b2748067a9d50ab57efc6423d7568c237c (patch)
treed8b00c6aaafe0269877e541e4ed1f5305b55ba9d /helpers/url_test.go
parent8d040c966f777a3fc462d0fb24775cb865519991 (diff)
helpers: Avoid adding language prefix if already present
Fixes #2444
Diffstat (limited to 'helpers/url_test.go')
-rw-r--r--helpers/url_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/helpers/url_test.go b/helpers/url_test.go
index d1fadb252..2cf93b859 100644
--- a/helpers/url_test.go
+++ b/helpers/url_test.go
@@ -69,12 +69,14 @@ func doTestAbsURL(t *testing.T, defaultInSubDir, addLanguage, multilingual bool,
expected string
}{
{"/test/foo", "http://base/", "http://base/MULTItest/foo"},
+ {"/" + lang + "/test/foo", "http://base/", "http://base/" + lang + "/test/foo"},
{"", "http://base/ace/", "http://base/ace/MULTI"},
{"/test/2/foo/", "http://base", "http://base/MULTItest/2/foo/"},
{"http://abs", "http://base/", "http://abs"},
{"schema://abs", "http://base/", "schema://abs"},
{"//schemaless", "http://base/", "//schemaless"},
{"test/2/foo/", "http://base/path", "http://base/path/MULTItest/2/foo/"},
+ {lang + "/test/2/foo/", "http://base/path", "http://base/path/" + lang + "/test/2/foo/"},
{"/test/2/foo/", "http://base/path", "http://base/MULTItest/2/foo/"},
{"http//foo", "http://base/path", "http://base/path/MULTIhttp/foo"},
}
@@ -141,6 +143,8 @@ func doTestRelURL(t *testing.T, defaultInSubDir, addLanguage, multilingual bool,
expected string
}{
{"/test/foo", "http://base/", false, "MULTI/test/foo"},
+ {"/" + lang + "/test/foo", "http://base/", false, "/" + lang + "/test/foo"},
+ {lang + "/test/foo", "http://base/", false, "/" + lang + "/test/foo"},
{"test.css", "http://base/sub", false, "/subMULTI/test.css"},
{"test.css", "http://base/sub", true, "MULTI/test.css"},
{"/test/", "http://base/", false, "MULTI/test/"},