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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
b6ad71a2
Commit
b6ad71a2
authored
May 06, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test for generator expressions (disabled)
parent
24c64823
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
tests/bugs.txt
tests/bugs.txt
+1
-0
tests/run/genexpr_T491.pyx
tests/run/genexpr_T491.pyx
+43
-0
No files found.
tests/bugs.txt
View file @
b6ad71a2
...
@@ -9,6 +9,7 @@ missing_baseclass_in_predecl_T262
...
@@ -9,6 +9,7 @@ missing_baseclass_in_predecl_T262
cfunc_call_tuple_args_T408
cfunc_call_tuple_args_T408
cascaded_list_unpacking_T467
cascaded_list_unpacking_T467
compile.cpp_operators
compile.cpp_operators
genexpr_T491
# CPython regression tests that don't current work:
# CPython regression tests that don't current work:
pyregr.test_threadsignals
pyregr.test_threadsignals
...
...
tests/run/genexpr_T491.pyx
0 → 100644
View file @
b6ad71a2
def
test_genexpr
():
"""
>>> gen = test_genexpr()
>>> list(gen)
[0, 1, 2, 3, 4]
"""
return
(
i
for
i
in
range
(
5
))
def
test_genexpr_typed
():
"""
>>> gen = test_genexpr_typed()
>>> list(gen)
[0, 1, 2, 3, 4]
"""
cdef
int
i
return
(
i
for
i
in
range
(
5
))
def
test_genexpr_funccall
():
"""
>>> test_genexpr_funccall()
[0, 1, 2, 3, 4]
"""
return
list
(
i
for
i
in
range
(
5
))
def
test_genexpr_scope
():
"""
>>> test_genexpr_scope()
([0, 1, 2, 3, 4], 'abc')
"""
i
=
'abc'
gen
=
(
i
for
i
in
range
(
5
))
lst
=
list
(
gen
)
return
lst
,
i
def
test_genexpr_closure
():
"""
>>> gen = test_genexpr_closure()
>>> list(gen)
['a', 'b', 'c']
"""
abc
=
'a'
+
'b'
+
'c'
return
(
c
for
c
in
abc
)
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