Index: src/pkg/text/template/exec_test.go |
=================================================================== |
--- a/src/pkg/text/template/exec_test.go |
+++ b/src/pkg/text/template/exec_test.go |
@@ -374,6 +374,8 @@ |
{"if map not unset", "{{if not .MXI.none}}ZERO{{else}}NON-ZERO{{end}}", "ZERO", tVal, true}, |
{"if $x with $y int", "{{if $x := true}}{{with $y := .I}}{{$x}},{{$y}}{{end}}{{end}}", "true,17", tVal, true}, |
{"if $x with $x int", "{{if $x := true}}{{with $x := .I}}{{$x}},{{end}}{{$x}}{{end}}", "17,true", tVal, true}, |
+ {"if else if", "{{if false}}FALSE{{else if true}}TRUE{{end}}", "TRUE", tVal, true}, |
+ {"if else chain", "{{if eq 1 3}}1{{else if eq 2 3}}2{{else if eq 3 3}}3{{end}}", "3", tVal, true}, |
// Print etc. |
{"print", `{{print "hello, print"}}`, "hello, print", tVal, true}, |