]> Cypherpunks repositories - gostls13.git/commitdiff
add test that was mistakenly not checked in, now fixed
authorRob Pike <r@golang.org>
Mon, 30 Jun 2008 23:52:17 +0000 (16:52 -0700)
committerRob Pike <r@golang.org>
Mon, 30 Jun 2008 23:52:17 +0000 (16:52 -0700)
SVN=125408

test/fixedbugs/bug059.go [new file with mode: 0644]
test/golden.out

diff --git a/test/fixedbugs/bug059.go b/test/fixedbugs/bug059.go
new file mode 100644 (file)
index 0000000..a798b6f
--- /dev/null
@@ -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);
+       }
+}
index 9f55668b6ce8131157eec5ffa5f27813a3a1a0bc..2d27e2a7f8607e11f14cc08ce503be63ba1a1835 100644 (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