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
7462942b
Commit
7462942b
authored
May 26, 1998
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some tests to make sure that long->int conversions near
sys.maxint and near -sys.maxint-1 work correctly.
parent
f7531812
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
Lib/test/test_types.py
Lib/test/test_types.py
+12
-0
No files found.
Lib/test/test_types.py
View file @
7462942b
...
...
@@ -78,6 +78,18 @@ if (-12L) + 24L <> 12L: raise TestFailed, 'long op'
if
(
-
12L
)
+
(
-
24L
)
<>
-
36L
:
raise
TestFailed
,
'long op'
if
not
12L
<
24L
:
raise
TestFailed
,
'long op'
if
not
-
24L
<
-
12L
:
raise
TestFailed
,
'long op'
x
=
sys
.
maxint
if
int
(
long
(
x
))
!=
x
:
raise
TestFailed
,
'long op'
try
:
int
(
long
(
x
)
+
1L
)
except
OverflowError
:
pass
else
:
raise
TestFailed
,
'long op'
x
=
-
x
if
int
(
long
(
x
))
!=
x
:
raise
TestFailed
,
'long op'
x
=
x
-
1
if
int
(
long
(
x
))
!=
x
:
raise
TestFailed
,
'long op'
try
:
int
(
long
(
x
)
-
1L
)
except
OverflowError
:
pass
else
:
raise
TestFailed
,
'long op'
print
'6.4.3 Floating point numbers'
if
12.0
+
24.0
<>
36.0
:
raise
TestFailed
,
'float op'
if
12.0
+
(
-
24.0
)
<>
-
12.0
:
raise
TestFailed
,
'float op'
...
...
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