Skip to content

Commit

Permalink
Expand template newline testcase to commands
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Feb 18, 2021
1 parent ae57ba6 commit 21e9eb1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions hugolib/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ func TestTemplateGoIssues(t *testing.T) {
{{ $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 */}}
{{/* Action/commands newlines, from Go 1.16, see https://github.com/golang/go/issues/29770 */}}
{{ $norway := dict
"country" "Norway"
"population" "5 millions"
Expand All @@ -598,7 +598,11 @@ func TestTemplateGoIssues(t *testing.T) {
"dialing_code" "+47"
}}
Population in Norway is {{ $norway.population }}
Population in Norway is {{
$norway.population
| lower
| upper
}}
`,
)
Expand All @@ -607,7 +611,7 @@ Population in Norway is {{ $norway.population }}

b.AssertFileContent("public/index.html", `
<script type="application/ld+json">{"@type":"WebPage","headline":"a \u0026 b"}</script>
Population in Norway is 5 millions
Population in Norway is 5 MILLIONS
`)
}
Expand Down

0 comments on commit 21e9eb1

Please sign in to comment.