Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
5270e035
Commit
5270e035
authored
Dec 18, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended test cases for for-loop and list comp
parent
aa2cc986
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
tests/run/listcomp.pyx
tests/run/listcomp.pyx
+6
-0
tests/run/r_forloop.pyx
tests/run/r_forloop.pyx
+8
-0
No files found.
tests/run/listcomp.pyx
View file @
5270e035
__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"
...
...
tests/run/r_forloop.pyx
View file @
5270e035
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment