PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/go/using_extend_runme.go

#
Go | 30 lines | 23 code | 7 blank | 0 comment | 12 complexity | 5dd23c2a7e1b586b8e408589b3a6bdd8 MD5 | raw file
 1package main
 2
 3import . "./using_extend"
 4
 5func main() {
 6	f := NewFooBar()
 7	if f.Blah(3).(int) != 3 {
 8		panic("blah(int)")
 9	}
10
11	if f.Blah(3.5) != 3.5 {
12		panic("blah(double)")
13	}
14
15	if f.Blah("hello").(string) != "hello" {
16		panic("blah(char *)")
17	}
18
19	if f.Blah(3, 4).(int) != 7 {
20		panic("blah(int,int)")
21	}
22
23	if f.Blah(3.5, 7.5) != (3.5 + 7.5) {
24		panic("blah(double,double)")
25	}
26
27	if f.Duh(3) != 3 {
28		panic("duh(int)")
29	}
30}