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
2789351e
Commit
2789351e
authored
Nov 25, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended test cases for tickets #600 and #598
parent
c758cc37
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
tests/run/genexpr_iterable_lookup_T600.pyx
tests/run/genexpr_iterable_lookup_T600.pyx
+15
-0
tests/run/list_comp_in_closure_T598.pyx
tests/run/list_comp_in_closure_T598.pyx
+14
-0
No files found.
tests/run/genexpr_iterable_lookup_T600.pyx
View file @
2789351e
...
@@ -16,3 +16,18 @@ def list_genexpr_iterable_lookup():
...
@@ -16,3 +16,18 @@ def list_genexpr_iterable_lookup():
result
=
list
(
x
*
2
for
x
in
x
if
x
%
2
==
0
)
result
=
list
(
x
*
2
for
x
in
x
if
x
%
2
==
0
)
assert
x
==
(
0
,
1
,
2
,
3
,
4
,
5
)
assert
x
==
(
0
,
1
,
2
,
3
,
4
,
5
)
return
result
return
result
@
cython
.
test_assert_path_exists
(
'//ComprehensionNode'
)
@
cython
.
test_fail_if_path_exists
(
'//SimpleCallNode'
)
def
genexpr_iterable_in_closure
():
"""
>>> genexpr_iterable_in_closure()
[0, 4, 8]
"""
x
=
'abc'
def
f
():
return
x
result
=
list
(
x
*
2
for
x
in
x
if
x
%
2
==
0
)
assert
x
==
'abc'
# don't leak in Py3 code
assert
f
()
==
'abc'
# don't leak in Py3 code
return
result
tests/run/list_comp_in_closure_T598.pyx
View file @
2789351e
...
@@ -25,3 +25,17 @@ def genexpr_in_closure():
...
@@ -25,3 +25,17 @@ def genexpr_in_closure():
assert
x
==
'abc'
# don't leak in Py3 code
assert
x
==
'abc'
# don't leak in Py3 code
assert
f
()
==
'abc'
# don't leak in Py3 code
assert
f
()
==
'abc'
# don't leak in Py3 code
return
result
return
result
def
genexpr_scope_in_closure
():
"""
>>> genexpr_scope_in_closure()
[0, 4, 8]
"""
i
=
2
x
=
'abc'
def
f
():
return
i
,
x
result
=
list
(
x
*
i
for
x
in
range
(
5
)
if
x
%
2
==
0
)
assert
x
==
'abc'
# don't leak in Py3 code
assert
f
()
==
2
,
'abc'
# don't leak in Py3 code
return
result
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