

def test_var_args1(self):

    def func(self, *args):
        return args
    code1 = py2js(func)
    code2 = py2js('func(2, 3)')
    assert (evaljs((code1 + code2), False) == '[2,3]')
    code2 = py2js('func()')
    assert (evaljs((code1 + code2), False) == '[]')
    code2 = py2js('a=[2,3]\nfunc(*a)')
    assert (evaljs((code1 + code2), False) == '[2,3]')
    code2 = py2js('a=[2,3]\nfunc(1,2,*a)')
    assert (evaljs((code1 + code2), False) == '[1,2,2,3]')

dataset/ETHPy150Open zoofIO/flexx/flexx/pyscript/tests/test_parser2.py TestFunctions.test_var_args1/original