rename overload_extendc testcase
This commit is contained in:
parent
a00b4f4463
commit
0bd41dc14d
7 changed files with 11 additions and 11 deletions
33
Examples/test-suite/go/overload_extend2_runme.go
Normal file
33
Examples/test-suite/go/overload_extend2_runme.go
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
package main
|
||||
|
||||
import "./overload_extend2"
|
||||
|
||||
func main() {
|
||||
f := overload_extend2.NewFoo()
|
||||
if f.Test(3) != 1 {
|
||||
panic(0)
|
||||
}
|
||||
if f.Test("hello") != 2 {
|
||||
panic(0)
|
||||
}
|
||||
if f.Test(3.5, 2.5) != 3 {
|
||||
panic(0)
|
||||
}
|
||||
if f.Test("hello", 20) != 1020 {
|
||||
panic(0)
|
||||
}
|
||||
if f.Test("hello", 20, 100) != 120 {
|
||||
panic(0)
|
||||
}
|
||||
|
||||
// C default args
|
||||
if f.Test(f) != 30 {
|
||||
panic(0)
|
||||
}
|
||||
if f.Test(f, 100) != 120 {
|
||||
panic(0)
|
||||
}
|
||||
if f.Test(f, 100, 200) != 300 {
|
||||
panic(0)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue