diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-12-03 13:54:45 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-02-18 14:11:48 +0100 |
commit | ae57ba6a9dee87347fa2d5e8c6865f390989622e (patch) | |
tree | df9ccdfe3373ad53b6128e159642c8af7eff4540 /hugolib/template_test.go | |
parent | cf3e077da304e6f4d7c22f8296e1382335d055c6 (diff) |
Add a test case for Go 1.16 template action newlines
Diffstat (limited to 'hugolib/template_test.go')
-rw-r--r-- | hugolib/template_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/hugolib/template_test.go b/hugolib/template_test.go index 769bcd4e6..265cea1cb 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" }} <script type="application/ld+json">{"@type":"WebPage","headline":"{{$title}}"}</script> + +{{/* 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", ` <script type="application/ld+json">{"@type":"WebPage","headline":"a \u0026 b"}</script> +Population in Norway is 5 millions `) } |