0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-16 15:01:07 +01:00

Relative URL tests

This commit is contained in:
Ethan Koenig 2017-07-06 12:42:56 -04:00
parent b1d7348a20
commit e14ea9979b

View file

@ -75,6 +75,10 @@ func TestURLJoin(t *testing.T) {
"https://try.gitea.io/", "/a/b/", "/c/"), "https://try.gitea.io/", "/a/b/", "/c/"),
newTest("https://try.gitea.io/a/c", newTest("https://try.gitea.io/a/c",
"https://try.gitea.io/", "/a/./b/", "../c/"), "https://try.gitea.io/", "/a/./b/", "../c/"),
newTest("a/b/c",
"a", "b/c/"),
newTest("a/b/d",
"a/", "b/c/", "/../d/"),
} { } {
assert.Equal(t, test.Expected, URLJoin(test.Base, test.Elements...)) assert.Equal(t, test.Expected, URLJoin(test.Base, test.Elements...))
} }