diff options
author | Anthony Fok <foka@debian.org> | 2015-03-11 11:34:57 -0600 |
---|---|---|
committer | bep <bjorn.erik.pedersen@gmail.com> | 2015-03-11 21:55:00 +0100 |
commit | 67df33f50069445d53d373790e8c636e47013a72 (patch) | |
tree | c4e9d646f32aa2a7a40e6c5597b904647bc85e3f /helpers/url_test.go | |
parent | 00f07c5374d859057c6e7c4731000b5978364819 (diff) |
Correct initialisms as suggested by golint
First step to use initialisms that golint suggests,
for example:
Line 116: func GetHtmlRenderer should be GetHTMLRenderer
as see on http://goreportcard.com/report/spf13/hugo
Thanks to @bep for the idea!
Note that command-line flags (cobra and pflag)
as well as struct fields like .BaseUrl and .Url
that are used in Go HTML templates need more work
to maintain backward-compatibility, and thus
are NOT yet dealt with in this commit.
First step in fixing #959.
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) { |