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
75562e93
Commit
75562e93
authored
Aug 03, 2000
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added testsuite for new zip() builtin.
parent
36f738b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
Lib/test/test_b2.py
Lib/test/test_b2.py
+36
-0
No files found.
Lib/test/test_b2.py
View file @
75562e93
...
...
@@ -255,6 +255,42 @@ if tuple(xrange(5,10)) <> tuple(range(5,10)): raise TestFailed, 'xrange(5,10)'
if
tuple
(
xrange
(
0
,
10
,
2
))
<>
tuple
(
range
(
0
,
10
,
2
)):
raise
TestFailed
,
'xrange(0,10,2)'
print
'zip'
a
=
(
1
,
2
,
3
)
b
=
(
4
,
5
,
6
)
t
=
[(
1
,
4
),
(
2
,
5
),
(
3
,
6
)]
if
zip
(
a
,
b
)
<>
t
:
raise
TestFailed
,
'zip(a, b) - same size, both tuples'
b
=
[
4
,
5
,
6
]
if
zip
(
a
,
b
)
<>
t
:
raise
TestFailed
,
'zip(a, b) - same size, tuple/list'
b
=
(
4
,
5
,
6
,
7
)
if
zip
(
a
,
b
)
<>
t
:
raise
TestFailed
,
'zip(a, b) - b is longer'
class
I
:
def
__getitem__
(
self
,
i
):
if
i
<
0
or
i
>
2
:
raise
IndexError
return
i
+
4
if
zip
(
a
,
I
())
<>
t
:
raise
TestFailed
,
'zip(a, b) - b is instance'
exc
=
0
try
:
zip
()
except
TypeError
:
exc
=
1
except
:
e
=
sys
.
exc_info
()[
0
]
raise
TestFailed
,
'zip() - no args, expected TypeError, got'
,
e
if
not
exc
:
raise
TestFailed
,
'zip() - no args, missing expected TypeError'
exc
=
0
try
:
zip
(
None
)
except
TypeError
:
exc
=
1
except
:
e
=
sys
.
exc_info
()[
0
]
raise
TestFailed
,
'zip(None) - expected TypeError, got'
,
e
if
not
exc
:
raise
TestFailed
,
'zip(None) - missing expected TypeError'
# Epilogue -- unlink the temp file
...
...
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