1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

all: Propagate baseURL error to the callers

This commit is contained in:
Bjørn Erik Pedersen
2017-03-25 14:37:04 +01:00
parent 148fedd227
commit 15b64d51da
18 changed files with 124 additions and 47 deletions

View File

@@ -48,4 +48,14 @@ func TestBaseURL(t *testing.T) {
require.NoError(t, err)
require.Equal(t, "webcal://hugo@rules.com", p)
// Test with "non-URLs". Some people will try to use these as a way to get
// relative URLs working etc.
b, err = newBaseURLFromString("/")
require.NoError(t, err)
require.Equal(t, "/", b.String())
b, err = newBaseURLFromString("")
require.NoError(t, err)
require.Equal(t, "", b.String())
}