aboutsummaryrefslogtreecommitdiffhomepage
path: root/helpers/pathspec_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2022-06-13 09:52:02 +0200
committerBjørn Erik Pedersen <[email protected]>2022-06-13 11:40:25 +0200
commita5a4422aaeffe0e9df713cf09c73a9cc423a2e1e (patch)
tree6d3b5d6b8a2d23aa59416a00a664b772f7d24581 /helpers/pathspec_test.go
parent617e094482cbb8e46e5606bc7ff5ead109419d4d (diff)
downloadhugo-a5a4422aaeffe0e9df713cf09c73a9cc423a2e1e.tar.gz
hugo-a5a4422aaeffe0e9df713cf09c73a9cc423a2e1e.zip
Fix relURL with leading slash when baseURL includes a subdirectory
Fixes #9994
Diffstat (limited to 'helpers/pathspec_test.go')
-rw-r--r--helpers/pathspec_test.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/helpers/pathspec_test.go b/helpers/pathspec_test.go
index c11299516..84448050d 100644
--- a/helpers/pathspec_test.go
+++ b/helpers/pathspec_test.go
@@ -32,7 +32,7 @@ func TestNewPathSpecFromConfig(t *testing.T) {
v.Set("uglyURLs", true)
v.Set("canonifyURLs", true)
v.Set("paginatePath", "side")
- v.Set("baseURL", "http://base.com")
+ v.Set("baseURL", "http://base.com/foo")
v.Set("themesDir", "thethemes")
v.Set("layoutDir", "thelayouts")
v.Set("workingDir", "thework")
@@ -53,7 +53,10 @@ func TestNewPathSpecFromConfig(t *testing.T) {
c.Assert(p.Language.Lang, qt.Equals, "no")
c.Assert(p.PaginatePath, qt.Equals, "side")
- c.Assert(p.BaseURL.String(), qt.Equals, "http://base.com")
+ c.Assert(p.BaseURL.String(), qt.Equals, "http://base.com/foo")
+ c.Assert(p.BaseURLString, qt.Equals, "http://base.com/foo")
+ c.Assert(p.BaseURLNoPathString, qt.Equals, "http://base.com")
+
c.Assert(p.ThemesDir, qt.Equals, "thethemes")
c.Assert(p.WorkingDir, qt.Equals, "thework")
}