summaryrefslogtreecommitdiff
path: root/test/syntax
diff options
context:
space:
mode:
Diffstat (limited to 'test/syntax')
-rw-r--r--test/syntax/chan.go17
-rw-r--r--test/syntax/slice.go9
-rw-r--r--test/syntax/topexpr.go6
-rw-r--r--test/syntax/vareq.go2
-rw-r--r--test/syntax/vareq1.go2
5 files changed, 22 insertions, 14 deletions
diff --git a/test/syntax/chan.go b/test/syntax/chan.go
new file mode 100644
index 000000000..48beb1e70
--- /dev/null
+++ b/test/syntax/chan.go
@@ -0,0 +1,17 @@
+// errchk $G -e $D/$F.go
+
+// Copyright 2010 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+type xyz struct {
+ ch chan
+} // ERROR "unexpected } in channel type"
+
+func Foo(y chan) { // ERROR "unexpected \) in channel type"
+}
+
+func Bar(x chan, y int) { // ERROR "unexpected comma in channel type"
+}
diff --git a/test/syntax/slice.go b/test/syntax/slice.go
deleted file mode 100644
index 7675ca187..000000000
--- a/test/syntax/slice.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// errchk $G -e $D/$F.go
-
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-var x = y[:z] // ERROR "missing lower bound in slice expression|undefined"
diff --git a/test/syntax/topexpr.go b/test/syntax/topexpr.go
index 83de49075..93d86fbe9 100644
--- a/test/syntax/topexpr.go
+++ b/test/syntax/topexpr.go
@@ -6,15 +6,15 @@
package main
-fmt.Printf("hello") // ERROR "non-declaration statement outside function body"
+fmt.Printf("hello") // ERROR "non-declaration statement outside function body|expected declaration"
func main() {
}
-x++ // ERROR "non-declaration statement outside function body"
+x++ // ERROR "non-declaration statement outside function body|expected declaration"
func init() {
}
-x,y := 1, 2 // ERROR "non-declaration statement outside function body"
+x,y := 1, 2 // ERROR "non-declaration statement outside function body|expected declaration"
diff --git a/test/syntax/vareq.go b/test/syntax/vareq.go
index 9be03c1d3..8525be8cf 100644
--- a/test/syntax/vareq.go
+++ b/test/syntax/vareq.go
@@ -7,4 +7,4 @@
package main
func main() {
- var x map[string]string{"a":"b"} // ERROR "unexpected { at end of statement"
+ var x map[string]string{"a":"b"} // ERROR "unexpected { at end of statement|expected ';' or '}' or newline"
diff --git a/test/syntax/vareq1.go b/test/syntax/vareq1.go
index 2d35b3ea0..9d70bea39 100644
--- a/test/syntax/vareq1.go
+++ b/test/syntax/vareq1.go
@@ -6,5 +6,5 @@
package main
-var x map[string]string{"a":"b"} // ERROR "unexpected { at end of statement"
+var x map[string]string{"a":"b"} // ERROR "unexpected { at end of statement|expected ';' or newline after top level declaration"