aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/collections_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2019-07-24 10:05:09 +0200
committerBjørn Erik Pedersen <[email protected]>2019-07-24 10:05:09 +0200
commit072aa7f110ddc8a8b9dbc6d4cad3e5ba6c2ac4d0 (patch)
tree97669cd7b75e51f8ba2924793c5cf2f6cf42707d /hugolib/collections_test.go
parent215d2ed883d5adbde1d119d33e2f2e88c8435f41 (diff)
downloadhugo-072aa7f110ddc8a8b9dbc6d4cad3e5ba6c2ac4d0.tar.gz
hugo-072aa7f110ddc8a8b9dbc6d4cad3e5ba6c2ac4d0.zip
hugolib: Add a symdiff test
Diffstat (limited to 'hugolib/collections_test.go')
-rw-r--r--hugolib/collections_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/hugolib/collections_test.go b/hugolib/collections_test.go
index 41681bc73..06bac80a3 100644
--- a/hugolib/collections_test.go
+++ b/hugolib/collections_test.go
@@ -142,6 +142,13 @@ tags_weight: %d
{{ printf "inTrue: %t" $inTrue }}
{{ printf "inFalse: %t" $inFalse }}
`)
+
+ b.WithTemplatesAdded("_default/single.html", `
+{{ $related := .Site.RegularPages.Related . }}
+{{ $symdiff := $related | symdiff .Site.RegularPages }}
+Related: {{ range $related }}{{ .RelPermalink }}|{{ end }}
+Symdiff: {{ range $symdiff }}{{ .RelPermalink }}|{{ end }}
+`)
b.CreateSites().Build(BuildCfg{})
assert.Equal(1, len(b.H.Sites))
@@ -152,6 +159,8 @@ tags_weight: %d
"inTrue: true",
"inFalse: false",
)
+
+ b.AssertFileContent("public/page1/index.html", `Related: /page2/|/page3/|`, `Symdiff: /page1/|`)
}
func TestAppendFunc(t *testing.T) {