Index: src/pkg/reflect/all_test.go |
=================================================================== |
--- a/src/pkg/reflect/all_test.go |
+++ b/src/pkg/reflect/all_test.go |
@@ -1743,3 +1743,15 @@ |
panic("zero Value") |
} |
} |
+ |
+func TestAlias(t *testing.T) { |
+ x := string("hello") |
+ v := ValueOf(&x).Elem() |
+ oldvalue := v.Interface() |
+ v.SetString("world") |
+ newvalue := v.Interface() |
+ |
+ if oldvalue != "hello" || newvalue != "world" { |
+ t.Errorf("aliasing: old=%q new=%q, want hello, world", oldvalue, newvalue) |
+ } |
+} |