]> Cypherpunks repositories - gostls13.git/commitdiff
text/template: one more test case
authorRob Pike <r@golang.org>
Sat, 3 Mar 2012 21:06:26 +0000 (08:06 +1100)
committerRob Pike <r@golang.org>
Sat, 3 Mar 2012 21:06:26 +0000 (08:06 +1100)
Missed a case for variadic functions with too few arguments.
The code passes, and with the right error, but might as well record the test case.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5732050

src/pkg/text/template/exec_test.go

index 83ca0022ba96337caa0815bd22abb53292c94965..70ab39cad20b20900413acc5de3045d492ae8364 100644 (file)
@@ -318,7 +318,8 @@ var execTests = []execTest{
        {".BinaryFuncBad0", "{{call .BinaryFunc 1 3}}", "", tVal, false},
        {".BinaryFuncBad1", "{{call .BinaryFunc `1` 3}}", "", tVal, false},
        {".VariadicFuncBad0", "{{call .VariadicFunc 3}}", "", tVal, false},
-       {".VariadicFuncIntBad0", "{{call .VariadicFuncInt `x`}}", "", tVal, false},
+       {".VariadicFuncIntBad0", "{{call .VariadicFuncInt}}", "", tVal, false},
+       {".VariadicFuncIntBad`", "{{call .VariadicFuncInt `x`}}", "", tVal, false},
 
        // Pipelines.
        {"pipeline", "-{{.Method0 | .Method2 .U16}}-", "-Method2: 16 M0-", tVal, true},