mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-28 12:50:51 +00:00
hugolib: Add a symdiff test
This commit is contained in:
parent
215d2ed883
commit
072aa7f110
1 changed files with 9 additions and 0 deletions
|
@ -141,6 +141,13 @@ tags_weight: %d
|
||||||
{{ printf "uniqPages: %T %d" $uniqPages (len $uniqPages) }}
|
{{ printf "uniqPages: %T %d" $uniqPages (len $uniqPages) }}
|
||||||
{{ printf "inTrue: %t" $inTrue }}
|
{{ printf "inTrue: %t" $inTrue }}
|
||||||
{{ printf "inFalse: %t" $inFalse }}
|
{{ 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{})
|
b.CreateSites().Build(BuildCfg{})
|
||||||
|
|
||||||
|
@ -152,6 +159,8 @@ tags_weight: %d
|
||||||
"inTrue: true",
|
"inTrue: true",
|
||||||
"inFalse: false",
|
"inFalse: false",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
b.AssertFileContent("public/page1/index.html", `Related: /page2/|/page3/|`, `Symdiff: /page1/|`)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAppendFunc(t *testing.T) {
|
func TestAppendFunc(t *testing.T) {
|
||||||
|
|
Loading…
Reference in a new issue