Commit f00d3fc1 authored by Stefan Behnel's avatar Stefan Behnel

Py3 test fix

parent b96e3243
...@@ -18,40 +18,40 @@ def short_binop(short val): ...@@ -18,40 +18,40 @@ def short_binop(short val):
""" """
Arithmetic in C is always done with at least int precision. Arithmetic in C is always done with at least int precision.
>>> short_binop(3) >>> print(short_binop(3))
'int called' int called
""" """
assert typeof(val + val) == "int", typeof(val + val) assert typeof(val + val) == "int", typeof(val + val)
assert typeof(val - val) == "int", typeof(val - val) assert typeof(val - val) == "int", typeof(val - val)
assert typeof(val & val) == "int", typeof(val & val) assert typeof(val & val) == "int", typeof(val & val)
cdef int_return x = f(val + val) cdef int_return x = f(val + val)
return x.msg return x.msg.decode('ASCII')
def short_unnop(short val): def short_unnop(short val):
""" """
Arithmetic in C is always done with at least int precision. Arithmetic in C is always done with at least int precision.
>>> short_unnop(3) >>> print(short_unnop(3))
'int called' int called
""" """
cdef int_return x = f(-val) cdef int_return x = f(-val)
return x.msg return x.msg.decode('ASCII')
def longlong_binop(long long val): def longlong_binop(long long val):
""" """
>>> longlong_binop(3) >>> print(longlong_binop(3))
'long long called' long long called
""" """
cdef longlong_return x = f(val * val) cdef longlong_return x = f(val * val)
return x.msg return x.msg.decode('ASCII')
def longlong_unnop(long long val): def longlong_unnop(long long val):
""" """
>>> longlong_unnop(3) >>> print(longlong_unnop(3))
'long long called' long long called
""" """
cdef longlong_return x = f(~val) cdef longlong_return x = f(~val)
return x.msg return x.msg.decode('ASCII')
def test_bint(bint a): def test_bint(bint a):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment