aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/text/template/parse/parse_test.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2012-08-24 13:00:24 -0700
committerRob Pike <r@golang.org>2012-08-24 13:00:24 -0700
commit8b2306623992b584cc18ec4c5287a94349eb5fb3 (patch)
treeac56ee5947d60e66635e49a425eca19b50f6e989 /src/pkg/text/template/parse/parse_test.go
parentcc842c738ea9a64570e306cbab37c3e3cf9a35dd (diff)
downloadgo-8b2306623992b584cc18ec4c5287a94349eb5fb3.tar.xz
text/template: catch (A).X as a parse error
This shouldn't be an error (see issue 3999), but until it's handled correctly, treat it as one to avoid confusion. Without this CL, (A).X parses as two arguments. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6473059
Diffstat (limited to 'src/pkg/text/template/parse/parse_test.go')
-rw-r--r--src/pkg/text/template/parse/parse_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pkg/text/template/parse/parse_test.go b/src/pkg/text/template/parse/parse_test.go
index da0df20950..da1ce1dd17 100644
--- a/src/pkg/text/template/parse/parse_test.go
+++ b/src/pkg/text/template/parse/parse_test.go
@@ -232,6 +232,9 @@ var parseTests = []parseTest{
{"invalid punctuation", "{{printf 3, 4}}", hasError, ""},
{"multidecl outside range", "{{with $v, $u := 3}}{{end}}", hasError, ""},
{"too many decls in range", "{{range $u, $v, $w := 3}}{{end}}", hasError, ""},
+ // This one should work but doesn't. Caught as a parse error to avoid confusion.
+ // TODO: Update after issue 3999 is resolved.
+ {"dot applied to parentheses", "{{printf (printf .).}}", hasError, ""},
// Equals (and other chars) do not assignments make (yet).
{"bug0a", "{{$x := 0}}{{$x}}", noError, "{{$x := 0}}{{$x}}"},
{"bug0b", "{{$x = 1}}{{$x}}", hasError, ""},