Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6451497d
Commit
6451497d
authored
Nov 18, 2012
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#7782: add a test for test_iter.
parent
01560de2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
Lib/test/test_iter.py
Lib/test/test_iter.py
+15
-0
No files found.
Lib/test/test_iter.py
View file @
6451497d
...
...
@@ -908,6 +908,21 @@ class TestCase(unittest.TestCase):
except
TypeError
:
pass
def
test_extending_list_with_iterator_does_not_segfault
(
self
):
# The code to extend a list with an iterator has a fair
# amount of nontrivial logic in terms of guessing how
# much memory to allocate in advance, "stealing" refs,
# and then shrinking at the end. This is a basic smoke
# test for that scenario.
def
gen
():
for
i
in
range
(
500
):
yield
i
lst
=
[
0
]
*
500
for
i
in
range
(
240
):
lst
.
pop
(
0
)
lst
.
extend
(
gen
())
self
.
assertEqual
(
len
(
lst
),
760
)
def
test_main
():
run_unittest
(
TestCase
)
...
...
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