Skip to content
Permalink
Browse files

hugolib: Add a symdiff test

  • Loading branch information...
bep committed Jul 24, 2019
1 parent 215d2ed commit 072aa7f110ddc8a8b9dbc6d4cad3e5ba6c2ac4d0
Showing with 9 additions and 0 deletions.
  1. +9 −0 hugolib/collections_test.go
@@ -141,6 +141,13 @@ tags_weight: %d
{{ printf "uniqPages: %T %d" $uniqPages (len $uniqPages) }}
{{ 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{})

@@ -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) {

0 comments on commit 072aa7f

Please sign in to comment.
You can’t perform that action at this time.