Commit 5270e035 authored by Stefan Behnel's avatar Stefan Behnel

extended test cases for for-loop and list comp

parent aa2cc986
__doc__ = u""" __doc__ = u"""
>>> smoketest() >>> smoketest()
[0, 4, 8] [0, 4, 8]
>>> int_runvar()
[0, 4, 8]
>>> typed() >>> typed()
[A, A, A] [A, A, A]
>>> iterdict() >>> iterdict()
...@@ -10,6 +12,10 @@ __doc__ = u""" ...@@ -10,6 +12,10 @@ __doc__ = u"""
def smoketest(): def smoketest():
print [x*2 for x in range(5) if x % 2 == 0] 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: cdef class A:
def __repr__(self): return u"A" def __repr__(self): return u"A"
......
...@@ -12,6 +12,9 @@ __doc__ = u""" ...@@ -12,6 +12,9 @@ __doc__ = u"""
Spam! Spam!
Spam! Spam!
Spam! Spam!
>>> go_c_int(1,5)
Spam!
Spam!
>>> go_c_all() >>> go_c_all()
Spam! Spam!
Spam! Spam!
...@@ -74,6 +77,11 @@ def go_c(): ...@@ -74,6 +77,11 @@ def go_c():
for i in range(4): for i in range(4):
print u"Spam!" 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(): def go_c_all():
cdef int i cdef int i
for i in range(8,2,-2): for i in range(8,2,-2):
......
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