Commit 9dfe25f6 authored by Stefan Behnel's avatar Stefan Behnel

test fixes

parent 1494945b
...@@ -41,7 +41,7 @@ DEF INT2 = 0x42 ...@@ -41,7 +41,7 @@ DEF INT2 = 0x42
DEF INT3 = -0x42 DEF INT3 = -0x42
DEF LONG = 666L DEF LONG = 666L
DEF FLOAT = 12.5 DEF FLOAT = 12.5
DEF STR = "spam" DEF STR = b"spam"
DEF TWO = TUPLE[1] DEF TWO = TUPLE[1]
DEF FIVE = TWO + 3 DEF FIVE = TWO + 3
DEF TRUE = TRUE_FALSE[0] DEF TRUE = TRUE_FALSE[0]
......
...@@ -13,21 +13,23 @@ from cython cimport typeof ...@@ -13,21 +13,23 @@ from cython cimport typeof
def simple(): def simple():
i = 3 i = 3
assert typeof(i) == "long" assert typeof(i) == "long", typeof(i)
x = 1.41 x = 1.41
assert typeof(x) == "double" assert typeof(x) == "double", typeof(x)
xptr = &x xptr = &x
assert typeof(xptr) == "double *" assert typeof(xptr) == "double *", typeof(xptr)
xptrptr = &xptr xptrptr = &xptr
assert typeof(xptrptr) == "double **" assert typeof(xptrptr) == "double **", typeof(xptrptr)
b = b"abc"
assert typeof(b) == "char *", typeof(b)
s = "abc" s = "abc"
assert typeof(s) == "char *" assert typeof(s) == "Python object", typeof(s)
u = u"xyz" u = u"xyz"
assert typeof(u) == "unicode object" assert typeof(u) == "unicode object", typeof(u)
L = [1,2,3] L = [1,2,3]
assert typeof(L) == "list object" assert typeof(L) == "list object", typeof(L)
t = (4,5,6) t = (4,5,6)
assert typeof(t) == "tuple object" assert typeof(t) == "tuple object", typeof(t)
def multiple_assignments(): def multiple_assignments():
a = 3 a = 3
......
...@@ -6,5 +6,5 @@ cdef grail(char *blarg, ...): ...@@ -6,5 +6,5 @@ cdef grail(char *blarg, ...):
pass pass
def test(): def test():
grail("test") grail(b"test")
grail("test", "toast") grail(b"test", b"toast")
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