Browse Source

Relative URL tests

tags/v1.2.0-rc1
Ethan Koenig 8 years ago
parent
commit
e14ea9979b
  1. 4
      modules/markdown/markdown_test.go

4
modules/markdown/markdown_test.go

@ -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...))
} }

Loading…
Cancel
Save