From 25d8a4976d17d0745d859d1dfad674f06bcd7fcb Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Mon, 26 Jan 2009 18:02:43 +0100 Subject: [PATCH] Added test for #184 --- tests/bugs/unsignedbehaviour_T184.pyx | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/bugs/unsignedbehaviour_T184.pyx diff --git a/tests/bugs/unsignedbehaviour_T184.pyx b/tests/bugs/unsignedbehaviour_T184.pyx new file mode 100644 index 00000000..50024a5d --- /dev/null +++ b/tests/bugs/unsignedbehaviour_T184.pyx @@ -0,0 +1,35 @@ +""" +>>> c_call() +(-10, 10) +>>> py_call() +(-10, 10) +>>> loop() +19 +>>> rangelist() +[-3, -2, -1, 0, 1, 2] +""" + +cdef c_g(int a, int b): + return (a, b) + +def py_g(a, b): + return (a, b) + +def c_call(): + cdef unsigned int i = 10 + return c_g(-i, i) + +def py_call(): + cdef unsigned int i = 10 + return py_g(-i, i) + +def loop(): + cdef unsigned int i = 10 + times = 0 + for i in range(-i,i): + times += 1 + return times + +def rangelist(): + cdef unsigned int i = 3 + return list(range(-i, i)) -- 2.26.2