test: match gccgo error messages

R=iant, golang-dev
CC=golang-dev
https://golang.org/cl/10365052
This commit is contained in:
Rémy Oudompheng 2013-06-20 08:21:14 +02:00
parent 2f70ac19d2
commit 004dd3d742
7 changed files with 11 additions and 11 deletions

View file

@ -11,8 +11,8 @@ var s string;
var m map[string]int; var m map[string]int;
func main() { func main() {
println(t["hi"]); // ERROR "non-integer slice index" println(t["hi"]); // ERROR "non-integer slice index|must be integer"
println(s["hi"]); // ERROR "non-integer string index" println(s["hi"]); // ERROR "non-integer string index|must be integer"
println(m[0]); // ERROR "as type string in map index" println(m[0]); // ERROR "cannot use.*as type string"
} }

View file

@ -9,7 +9,7 @@
package flag package flag
var commandLine = NewFlagSet() // ERROR "loop" var commandLine = NewFlagSet() // ERROR "loop|depends upon itself"
type FlagSet struct { type FlagSet struct {
} }

View file

@ -8,5 +8,5 @@ package foo
var i int var i int
func (*i) bar() // ERROR "not a type" func (*i) bar() // ERROR "not a type|expected type"

View file

@ -12,12 +12,12 @@ package foo
var _ = map[string]string{ var _ = map[string]string{
"1": "2", "1": "2",
"3", "4", // ERROR "missing key" "3", "4", // ERROR "missing key|must have keys"
} }
var _ = []string{ var _ = []string{
"foo", "foo",
"bar", "bar",
20, // ERROR "cannot use" 20, // ERROR "cannot use|incompatible type"
} }

View file

@ -7,5 +7,5 @@
package foo package foo
var s [][10]int var s [][10]int
const m = len(s[len(s)-1]) // ERROR "is not a constant" const m = len(s[len(s)-1]) // ERROR "is not a constant|is not constant"

View file

@ -16,5 +16,5 @@ func (T) foo() {}
func main() { func main() {
av := T{} av := T{}
pav := &av pav := &av
(**T).foo(&pav) // ERROR "no method foo" (**T).foo(&pav) // ERROR "no method foo|requires named type or pointer to named"
} }

View file

@ -13,7 +13,7 @@ import "fmt"
func main() { func main() {
var s uint var s uint
fmt.Println(1.0 + 1<<s) // ERROR "invalid operation" fmt.Println(1.0 + 1<<s) // ERROR "invalid operation|non-integer type"
x := 1.0 + 1<<s // ERROR "invalid operation" x := 1.0 + 1<<s // ERROR "invalid operation|non-integer type"
_ = x _ = x
} }