PageRenderTime 13ms CodeModel.GetById 1ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

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

#
Go | 38 lines | 31 code | 7 blank | 0 comment | 18 complexity | 6a236c980bbcb922730ea32ddc54c25e MD5 | raw file
 1package main
 2
 3import "./varargs_overload"
 4
 5func main() {
 6	if varargs_overload.Vararg_over1("Hello") != "Hello" {
 7		panic(0)
 8	}
 9	if varargs_overload.Vararg_over1(2) != "2" {
10		panic(1)
11	}
12
13	if varargs_overload.Vararg_over2("Hello") != "Hello" {
14		panic(2)
15	}
16	if varargs_overload.Vararg_over2(2, 2.2) != "2 2.2" {
17		panic(3)
18	}
19
20	if varargs_overload.Vararg_over3("Hello") != "Hello" {
21		panic(4)
22	}
23	if varargs_overload.Vararg_over3(2, 2.2, "hey") != "2 2.2 hey" {
24		panic(5)
25	}
26
27	if varargs_overload.Vararg_over4("Hello") != "Hello" {
28		panic(6)
29	}
30
31	if varargs_overload.Vararg_over4(123) != "123" {
32		panic(7)
33	}
34
35	if varargs_overload.Vararg_over4("Hello", 123) != "Hello" {
36		panic(8)
37	}
38}