diff options
Diffstat (limited to 'src/text/template/exec_test.go')
| -rw-r--r-- | src/text/template/exec_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/text/template/exec_test.go b/src/text/template/exec_test.go index abce27ff3d..0f1ad62380 100644 --- a/src/text/template/exec_test.go +++ b/src/text/template/exec_test.go @@ -531,6 +531,8 @@ var execTests = []execTest{ {"bug14a", "{{(nil).True}}", "", tVal, false}, {"bug14b", "{{$x := nil}}{{$x.anything}}", "", tVal, false}, {"bug14c", `{{$x := (1.0)}}{{$y := ("hello")}}{{$x.anything}}{{$y.true}}`, "", tVal, false}, + // Didn't call validateType on function results. Issue 10800. + {"bug15", "{{valueString returnInt}}", "", tVal, false}, } func zeroArgs() string { @@ -570,6 +572,11 @@ func valueString(v string) string { return "value is ignored" } +// returnInt returns an int +func returnInt() int { + return 7 +} + func add(args ...int) int { sum := 0 for _, x := range args { @@ -611,6 +618,7 @@ func testExecute(execTests []execTest, template *Template, t *testing.T) { "makemap": makemap, "mapOfThree": mapOfThree, "oneArg": oneArg, + "returnInt": returnInt, "stringer": stringer, "typeOf": typeOf, "valueString": valueString, |
