From 5270e035899e3ee4cb92f63baaa0cb4ae7e9ef30 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 18 Dec 2008 17:35:25 +0100 Subject: [PATCH] extended test cases for for-loop and list comp --- tests/run/listcomp.pyx | 6 ++++++ tests/run/r_forloop.pyx | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/tests/run/listcomp.pyx b/tests/run/listcomp.pyx index a7b9d1c2..f87eca09 100644 --- a/tests/run/listcomp.pyx +++ b/tests/run/listcomp.pyx @@ -1,6 +1,8 @@ __doc__ = u""" >>> smoketest() [0, 4, 8] +>>> int_runvar() +[0, 4, 8] >>> typed() [A, A, A] >>> iterdict() @@ -10,6 +12,10 @@ __doc__ = u""" def smoketest(): print [x*2 for x in range(5) if x % 2 == 0] +def int_runvar(): + cdef int x + print [x*2 for x in range(5) if x % 2 == 0] + cdef class A: def __repr__(self): return u"A" diff --git a/tests/run/r_forloop.pyx b/tests/run/r_forloop.pyx index 4f5b6523..463d6477 100644 --- a/tests/run/r_forloop.pyx +++ b/tests/run/r_forloop.pyx @@ -12,6 +12,9 @@ __doc__ = u""" Spam! Spam! Spam! + >>> go_c_int(1,5) + Spam! + Spam! >>> go_c_all() Spam! Spam! @@ -74,6 +77,11 @@ def go_c(): for i in range(4): print u"Spam!" +def go_c_int(int a, int b): + cdef int i + for i in range(a,b,2): + print u"Spam!" + def go_c_all(): cdef int i for i in range(8,2,-2): -- 2.26.2