summaryrefslogtreecommitdiff
path: root/src/pkg/go/parser/parser_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2010-04-27 11:57:17 -0700
committerRobert Griesemer <gri@golang.org>2010-04-27 11:57:17 -0700
commite0db7363315998164f147c5734c2fbadbde505d8 (patch)
treef39d85f4b4c800a912288b9dcda4b82d905e2678 /src/pkg/go/parser/parser_test.go
parentfa1813d851ab100374028deff5db40b512259205 (diff)
downloadgolang-e0db7363315998164f147c5734c2fbadbde505d8.tar.gz
go/parser: don't require parens around composite literals inside a composite literal
within an if, for, or switch control clause R=rsc CC=golang-dev http://codereview.appspot.com/943046
Diffstat (limited to 'src/pkg/go/parser/parser_test.go')
-rw-r--r--src/pkg/go/parser/parser_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pkg/go/parser/parser_test.go b/src/pkg/go/parser/parser_test.go
index 75ebd8cec..01327a41d 100644
--- a/src/pkg/go/parser/parser_test.go
+++ b/src/pkg/go/parser/parser_test.go
@@ -38,6 +38,9 @@ var validPrograms = []interface{}{
`package main; func f(func() func() func())` + "\n",
`package main; func f(...)` + "\n",
`package main; func f(float, ...int)` + "\n",
+ `package main; type T []int; var a []bool; func f() { if a[T{42}[0]] {} }` + "\n",
+ `package main; type T []int; func g(int) bool { return true }; func f() { if g(T{42}[0]) {} }` + "\n",
+ `package main; type T []int; func f() { for _ = range []int{T{42}[0]} {} }` + "\n",
}