def test_mutability(): ty = ts.function(ts.int_, (ts.float_,)) ty.args try: ty.args = [1, 2] except AttributeError as e: pass else: raise Exception("Expected: AttributeError: Cannot set attribute 'args' of type ...")
def test_mutability(): ty = ts.function(ts.int_, (ts.float_,)) ty.args try: ty.args = [1, 2] except AttributeError as e: pass else: raise Exception( "Expected: AttributeError: Cannot set attribute 'args' of type ...")
def test_functions(): functype1 = ts.function(ts.int_, (ts.float_,)) functype2 = ts.function(ts.int_, (ts.float_,)) functype3 = ts.function(ts.int_, (ts.float_,), is_vararg=False) functype4 = ts.function(ts.int_, (ts.float_,), name="hello") functype5 = ts.function(ts.int_, (ts.float_,), name="hello", is_vararg=False) functype6 = ts.function(ts.int_, (ts.float_,), name="hello", is_vararg=True) assert functype1 is functype2 assert functype1 is functype3 assert functype1 is not functype4 assert functype1 is not functype5 assert functype1 is not functype6 assert functype4 is functype5 assert functype4 is not functype6
def test_ctypes_functions(): # TODO: unifiy with test_llvm_functions functype = ts.function(ts.int_, (ts.float_,)) cfunctype = cts.function(cts.int_, (cts.float_,)) assert ct(functype) == cfunctype
def test_llvm_functions(): functype = ts.function(ts.int_, (ts.float_,)) lfunctype = lts.function(lts.int_, (lts.float_,)) assert llvmt(functype) == lfunctype
def test_functions(): functype = ts.function(ts.int_, (ts.float_, )) assert str(functype) == "int (*)(float32)", functype functype = ts.function(ts.int_, (ts.float_, ), "hello") assert str(functype) == "int (*hello)(float32)", functype
def test_functions(): functype = ts.function(ts.int_, (ts.float_,)) assert str(functype) == "int (*)(float32)", functype functype = ts.function(ts.int_, (ts.float_,), "hello") assert str(functype) == "int (*hello)(float32)", functype
def test_llvm_functions(): functype = ts.function(ts.int_, (ts.float_, )) lfunctype = lts.function(lts.int_, (lts.float_, )) assert llvmt(functype) == lfunctype
def test_ctypes_functions(): # TODO: unifiy with test_llvm_functions functype = ts.function(ts.int_, (ts.float_, )) cfunctype = cts.function(cts.int_, (cts.float_, )) assert ct(functype) == cfunctype