diff options
Diffstat (limited to 'helpers/url_test.go')
-rw-r--r-- | helpers/url_test.go | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/helpers/url_test.go b/helpers/url_test.go index c38750a63..35ade94e5 100644 --- a/helpers/url_test.go +++ b/helpers/url_test.go @@ -19,7 +19,7 @@ func TestUrlize(t *testing.T) { } for _, test := range tests { - output := Urlize(test.input) + output := URLize(test.input) if output != test.expected { t.Errorf("Expected %#v, got %#v\n", test.expected, output) } @@ -36,8 +36,8 @@ func TestSanitizeUrl(t *testing.T) { } for _, test := range tests { - o1 := SanitizeUrl(test.input) - o2 := SanitizeUrlKeepTrailingSlash(test.input) + o1 := SanitizeURL(test.input) + o2 := SanitizeURLKeepTrailingSlash(test.input) expected2 := test.expected @@ -88,7 +88,7 @@ func TestUrlPrep(t *testing.T) { {true, "/section/name/index.html", "/section/name.html"}, } for i, d := range data { - output := UrlPrep(d.ugly, d.input) + output := URLPrep(d.ugly, d.input) if d.output != output { t.Errorf("Test #%d failed. Expected %q got %q", i, d.output, output) } @@ -98,7 +98,7 @@ func TestUrlPrep(t *testing.T) { func TestAddContextRoot(t *testing.T) { tests := []struct { - baseUrl string + baseURL string url string expected string }{ @@ -114,7 +114,7 @@ func TestAddContextRoot(t *testing.T) { } for _, test := range tests { - output := AddContextRoot(test.baseUrl, test.url) + output := AddContextRoot(test.baseURL, test.url) if output != test.expected { t.Errorf("Expected %#v, got %#v\n", test.expected, output) } @@ -122,22 +122,22 @@ func TestAddContextRoot(t *testing.T) { } func TestPretty(t *testing.T) { - assert.Equal(t, PrettifyUrlPath("/section/name.html"), "/section/name/index.html") - assert.Equal(t, PrettifyUrlPath("/section/sub/name.html"), "/section/sub/name/index.html") - assert.Equal(t, PrettifyUrlPath("/section/name/"), "/section/name/index.html") - assert.Equal(t, PrettifyUrlPath("/section/name/index.html"), "/section/name/index.html") - assert.Equal(t, PrettifyUrlPath("/index.html"), "/index.html") - assert.Equal(t, PrettifyUrlPath("/name.xml"), "/name/index.xml") - assert.Equal(t, PrettifyUrlPath("/"), "/") - assert.Equal(t, PrettifyUrlPath(""), "/") - assert.Equal(t, PrettifyUrl("/section/name.html"), "/section/name") - assert.Equal(t, PrettifyUrl("/section/sub/name.html"), "/section/sub/name") - assert.Equal(t, PrettifyUrl("/section/name/"), "/section/name") - assert.Equal(t, PrettifyUrl("/section/name/index.html"), "/section/name") - assert.Equal(t, PrettifyUrl("/index.html"), "/") - assert.Equal(t, PrettifyUrl("/name.xml"), "/name/index.xml") - assert.Equal(t, PrettifyUrl("/"), "/") - assert.Equal(t, PrettifyUrl(""), "/") + assert.Equal(t, PrettifyURLPath("/section/name.html"), "/section/name/index.html") + assert.Equal(t, PrettifyURLPath("/section/sub/name.html"), "/section/sub/name/index.html") + assert.Equal(t, PrettifyURLPath("/section/name/"), "/section/name/index.html") + assert.Equal(t, PrettifyURLPath("/section/name/index.html"), "/section/name/index.html") + assert.Equal(t, PrettifyURLPath("/index.html"), "/index.html") + assert.Equal(t, PrettifyURLPath("/name.xml"), "/name/index.xml") + assert.Equal(t, PrettifyURLPath("/"), "/") + assert.Equal(t, PrettifyURLPath(""), "/") + assert.Equal(t, PrettifyURL("/section/name.html"), "/section/name") + assert.Equal(t, PrettifyURL("/section/sub/name.html"), "/section/sub/name") + assert.Equal(t, PrettifyURL("/section/name/"), "/section/name") + assert.Equal(t, PrettifyURL("/section/name/index.html"), "/section/name") + assert.Equal(t, PrettifyURL("/index.html"), "/") + assert.Equal(t, PrettifyURL("/name.xml"), "/name/index.xml") + assert.Equal(t, PrettifyURL("/"), "/") + assert.Equal(t, PrettifyURL(""), "/") } func TestUgly(t *testing.T) { |