/trunk/Examples/test-suite/go/smart_pointer_member_runme.go
Go | 30 lines | 23 code | 7 blank | 0 comment | 8 complexity | bb2712b232f15a26d2ace3f3c031629a MD5 | raw file
1package main 2 3import "fmt" 4import . "./smart_pointer_member" 5 6func main() { 7 f := NewFoo() 8 f.SetY(1) 9 10 if f.GetY() != 1 { 11 panic(0) 12 } 13 14 b := NewBar(f) 15 b.SetY(2) 16 17 if f.GetY() != 2 { 18 fmt.Println(f.GetY()) 19 fmt.Println(b.GetY()) 20 panic(0) 21 } 22 23 if b.GetX() != f.GetX() { 24 panic(0) 25 } 26 27 if b.GetZ() != GetFooZ() { 28 panic(0) 29 } 30}