summaryrefslogtreecommitdiff
path: root/Examples/test-suite/python/overload_extend2_runme.py
blob: 923a9a7e34b0fca0bdb9cbd9bf93c5fa0b5b7d9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import overload_extend2

f = overload_extend2.Foo()
if f.test(3) != 1:
    raise RuntimeError
if f.test("hello") != 2:
    raise RuntimeError
if f.test(3.5, 2.5) != 3:
    raise RuntimeError
if f.test("hello", 20) != 1020:
    raise RuntimeError
if f.test("hello", 20, 100) != 120:
    raise RuntimeError

# C default args
if f.test(f) != 30:
    raise RuntimeError
if f.test(f, 100) != 120:
    raise RuntimeError
if f.test(f, 100, 200) != 300:
    raise RuntimeError