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
b046b763
Commit
b046b763
authored
Nov 08, 2000
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test cases to detect regression on SourceForge bug #121965.
parent
0b796fa5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
Lib/test/test_b2.py
Lib/test/test_b2.py
+14
-0
No files found.
Lib/test/test_b2.py
View file @
b046b763
...
...
@@ -254,6 +254,20 @@ if tuple(xrange(10)) <> tuple(range(10)): raise TestFailed, 'xrange(10)'
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)'
# regression tests for SourceForge bug #121695
def
_range_test
(
r
):
assert
r
.
start
!=
r
.
stop
,
'Test not valid for passed-in xrange object.'
if
r
.
stop
in
r
:
raise
TestFailed
,
'r.stop in '
+
`r`
if
r
.
stop
-
r
.
step
not
in
r
:
raise
TestFailed
,
'r.stop-r.step not in '
+
`r`
if
r
.
start
not
in
r
:
raise
TestFailed
,
'r.start not in '
+
`r`
if
r
.
stop
+
r
.
step
in
r
:
raise
TestFailed
,
'r.stop+r.step in '
+
`r`
_range_test
(
xrange
(
10
))
_range_test
(
xrange
(
9
,
-
1
,
-
1
))
_range_test
(
xrange
(
0
,
10
,
2
))
print
'zip'
a
=
(
1
,
2
,
3
)
...
...
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