diff options
author | bep <[email protected]> | 2015-05-05 16:02:52 +0200 |
---|---|---|
committer | bep <[email protected]> | 2015-05-05 16:02:44 +0200 |
commit | bea9280fb35b156062e63afffd9d85ac5aac88f5 (patch) | |
tree | 4b70a598d06bdcefb2b2aba295c19c111b65235e /helpers/url_test.go | |
parent | bef3df7481027254a6711965828cd120fa5deb7c (diff) | |
download | hugo-bea9280fb35b156062e63afffd9d85ac5aac88f5.tar.gz hugo-bea9280fb35b156062e63afffd9d85ac5aac88f5.zip |
Do not add trailing slash to baseURL
Fixes #1105
Diffstat (limited to 'helpers/url_test.go')
-rw-r--r-- | helpers/url_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/helpers/url_test.go b/helpers/url_test.go index b11be3521..1dabda273 100644 --- a/helpers/url_test.go +++ b/helpers/url_test.go @@ -31,11 +31,12 @@ func TestSanitizeURL(t *testing.T) { input string expected string }{ - {"http://foo.bar/", "http://foo.bar/"}, + {"http://foo.bar/", "http://foo.bar"}, + {"http://foo.bar", "http://foo.bar"}, // issue #1105 {"http://foo.bar/zoo/", "http://foo.bar/zoo"}, // issue #931 } - for _, test := range tests { + for i, test := range tests { o1 := SanitizeURL(test.input) o2 := SanitizeURLKeepTrailingSlash(test.input) @@ -46,10 +47,10 @@ func TestSanitizeURL(t *testing.T) { } if o1 != test.expected { - t.Errorf("Expected %#v, got %#v\n", test.expected, o1) + t.Errorf("[%d] 1: Expected %#v, got %#v\n", i, test.expected, o1) } if o2 != expected2 { - t.Errorf("Expected %#v, got %#v\n", expected2, o2) + t.Errorf("[%d] 2: Expected %#v, got %#v\n", i, expected2, o2) } } } |