hugolib: Fix broken test

This commit is contained in:
Bjørn Erik Pedersen 2019-07-24 19:50:34 +02:00
parent 072aa7f110
commit fa28df1058
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -123,7 +123,7 @@ func TestCollectionsFuncs(t *testing.T) {
pageContent := ` pageContent := `
--- ---
title: "Page" title: "Page %d"
tags: ["blue", "green"] tags: ["blue", "green"]
tags_weight: %d tags_weight: %d
--- ---
@ -131,8 +131,8 @@ tags_weight: %d
` `
b := newTestSitesBuilder(t) b := newTestSitesBuilder(t)
b.WithSimpleConfigFile(). b.WithSimpleConfigFile().
WithContent("page1.md", fmt.Sprintf(pageContent, 10), "page2.md", fmt.Sprintf(pageContent, 20), WithContent("page1.md", fmt.Sprintf(pageContent, 10, 10), "page2.md", fmt.Sprintf(pageContent, 20, 20),
"page3.md", fmt.Sprintf(pageContent, 30)). "page3.md", fmt.Sprintf(pageContent, 30, 30)).
WithTemplatesAdded("index.html", ` WithTemplatesAdded("index.html", `
{{ $uniqPages := first 2 .Site.RegularPages | append .Site.RegularPages | uniq }} {{ $uniqPages := first 2 .Site.RegularPages | append .Site.RegularPages | uniq }}
{{ $inTrue := in .Site.RegularPages (index .Site.RegularPages 1) }} {{ $inTrue := in .Site.RegularPages (index .Site.RegularPages 1) }}