1
0
mirror of https://github.com/golang/go synced 2024-11-11 21:50:21 -07:00

add test that was mistakenly not checked in, now fixed

SVN=125408
This commit is contained in:
Rob Pike 2008-06-30 16:52:17 -07:00
parent 6973e3813f
commit 0b6e6afb76
2 changed files with 36 additions and 3 deletions

34
test/fixedbugs/bug059.go Normal file
View File

@ -0,0 +1,34 @@
// $G $D/$F.go && $L $F.$A && ./$A.out
// Copyright 2009 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
func P(a *[]string) string {
s := "{";
for i := 0; i < 2; i++ {
if i > 0 {
s += ","
}
s += `"` + a[i] + `"`;
}
s +="}";
return s;
}
func main() {
m := new(map[string] *[]string);
as := new([2]string);
as[0] = "0";
as[1] = "1";
m["0"] = as;
a := m["0"];
a[0] = "x";
m["0"][0] = "deleted";
if m["0"][0] != "deleted" {
sys.exit(1);
}
}

View File

@ -306,9 +306,6 @@ BUG: compilation should succeed
bugs/bug057.go:13: syntax error
BUG: compilation should succeed
=========== bugs/bug059.go
BUG: crashes
=========== bugs/bug060.go
BUG: crashes
@ -369,3 +366,5 @@ BUG: known to fail incorrectly
=========== fixedbugs/bug045.go
=========== fixedbugs/bug058.go
=========== fixedbugs/bug059.go