/trunk/Examples/test-suite/python/varargs_runme.py
Python | 36 lines | 25 code | 10 blank | 1 comment | 11 complexity | e78b03dabde4daf9b18b8c18a71b8cb2 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- import varargs
- if varargs.test("Hello") != "Hello":
- raise RuntimeError, "Failed"
- f = varargs.Foo("Greetings")
- if f.str != "Greetings":
- raise RuntimeError, "Failed"
- if f.test("Hello") != "Hello":
- raise RuntimeError, "Failed"
- if varargs.test_def("Hello",1) != "Hello":
- raise RuntimeError, "Failed"
- if varargs.test_def("Hello") != "Hello":
- raise RuntimeError, "Failed"
- ###
- if varargs.test_plenty("Hello") != "Hello":
- raise RuntimeError, "Failed"
- if varargs.test_plenty("Hello", 1) != "Hello":
- raise RuntimeError, "Failed"
- if varargs.test_plenty("Hello", 1, 2) != "Hello":
- raise RuntimeError, "Failed"
- try:
- varargs.test_plenty("Hello", 1, 2, 3)
- raise RuntimeError
- except NotImplementedError:
- pass
- except TypeError:
- pass