PageRenderTime 21ms CodeModel.GetById 9ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

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

#
Go | 33 lines | 29 code | 3 blank | 1 comment | 16 complexity | a83fb54788875200b23a448d9ceec100 MD5 | raw file
 1package main
 2
 3import "./overload_extendc"
 4
 5func main() {
 6	f := overload_extendc.NewFoo()
 7	if f.Test(3) != 1 {
 8		panic(0)
 9	}
10	if f.Test("hello") != 2 {
11		panic(0)
12	}
13	if f.Test(3.5, 2.5) != 3 {
14		panic(0)
15	}
16	if f.Test("hello", 20) != 1020 {
17		panic(0)
18	}
19	if f.Test("hello", 20, 100) != 120 {
20		panic(0)
21	}
22
23	// C default args
24	if f.Test(f) != 30 {
25		panic(0)
26	}
27	if f.Test(f, 100) != 120 {
28		panic(0)
29	}
30	if f.Test(f, 100, 200) != 300 {
31		panic(0)
32	}
33}