diff options
Diffstat (limited to 'src/text/template/parse/parse_test.go')
| -rw-r--r-- | src/text/template/parse/parse_test.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/text/template/parse/parse_test.go b/src/text/template/parse/parse_test.go index 4a504fa7c8..faac06fe5a 100644 --- a/src/text/template/parse/parse_test.go +++ b/src/text/template/parse/parse_test.go @@ -230,6 +230,9 @@ var parseTests = []parseTest{ // Errors. {"unclosed action", "hello{{range", hasError, ""}, {"unmatched end", "{{end}}", hasError, ""}, + {"unmatched else", "{{else}}", hasError, ""}, + {"unmatched else after if", "{{if .X}}hello{{end}}{{else}}", hasError, ""}, + {"multiple else", "{{if .X}}1{{else}}2{{else}}3{{end}}", hasError, ""}, {"missing end", "hello{{range .x}}", hasError, ""}, {"missing end after else", "hello{{range .x}}{{else}}", hasError, ""}, {"undefined function", "hello{{undefined}}", hasError, ""}, |
