From: Bjørn Erik Pedersen Date: Thu, 3 Dec 2020 12:54:45 +0000 (+0100) Subject: Add a test case for Go 1.16 template action newlines X-Git-Tag: v0.81.0~18 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ae57ba6a9dee87347fa2d5e8c6865f390989622e;p=brevno-suite%2Fhugo Add a test case for Go 1.16 template action newlines --- diff --git a/hugolib/template_test.go b/hugolib/template_test.go index 769bcd4e..265cea1c 100644 --- a/hugolib/template_test.go +++ b/hugolib/template_test.go @@ -584,6 +584,22 @@ func TestTemplateGoIssues(t *testing.T) { "index.html", ` {{ $title := "a & b" }} + +{{/* Action newlines, from Go 1.16, see https://github.com/golang/go/issues/29770 */}} +{{ $norway := dict + "country" "Norway" + "population" "5 millions" + "language" "Norwegian" + "language_code" "nb" + "weather" "freezing cold" + "capitol" "Oslo" + "largest_city" "Oslo" + "currency" "Norwegian krone" + "dialing_code" "+47" +}} + +Population in Norway is {{ $norway.population }} + `, ) @@ -591,6 +607,7 @@ func TestTemplateGoIssues(t *testing.T) { b.AssertFileContent("public/index.html", ` +Population in Norway is 5 millions `) }