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

/trunk/Examples/test-suite/python/overload_extendc_runme.py

#
Python | 22 lines | 18 code | 3 blank | 1 comment | 8 complexity | 064554951c5c0a3c50f19bee02d81791 MD5 | raw file
 1import overload_extendc
 2
 3f = overload_extendc.Foo()
 4if f.test(3) != 1:
 5    raise RuntimeError
 6if f.test("hello") != 2:
 7    raise RuntimeError
 8if f.test(3.5,2.5) != 3:
 9    raise RuntimeError
10if f.test("hello",20) != 1020:
11    raise RuntimeError
12if f.test("hello",20,100) != 120:
13    raise RuntimeError
14
15# C default args
16if f.test(f) != 30:
17    raise RuntimeError
18if f.test(f,100) != 120:
19    raise RuntimeError
20if f.test(f,100,200) != 300:
21    raise RuntimeError
22