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
bc1c7a08
Commit
bc1c7a08
authored
Sep 04, 2001
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a typo and added more tests.
parent
e2a60009
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
Lib/test/test_long_future.py
Lib/test/test_long_future.py
+12
-1
No files found.
Lib/test/test_long_future.py
View file @
bc1c7a08
...
...
@@ -17,14 +17,16 @@ def test_true_division():
verify
(
1
/
huge
==
0.0
)
verify
(
1L
/
huge
==
0.0
)
verify
(
1
/
mhuge
==
0.0
)
verify
(
1L
/
mhuge
==
-
0.0
)
verify
(
1L
/
mhuge
==
0.0
)
verify
((
666
*
huge
+
(
huge
>>
1
))
/
huge
==
666.5
)
verify
((
666
*
mhuge
+
(
mhuge
>>
1
))
/
mhuge
==
666.5
)
verify
((
666
*
huge
+
(
huge
>>
1
))
/
mhuge
==
-
666.5
)
verify
((
666
*
mhuge
+
(
mhuge
>>
1
))
/
huge
==
-
666.5
)
verify
(
huge
/
(
huge
<<
1
)
==
0.5
)
verify
((
1000000
*
huge
)
/
huge
==
1000000
)
namespace
=
{
'huge'
:
huge
,
'mhuge'
:
mhuge
}
for
overflow
in
[
"float(huge)"
,
"float(mhuge)"
,
"huge / 1"
,
"huge / 2L"
,
"huge / -1"
,
"huge / -2L"
,
"mhuge / 100"
,
"mhuge / 100L"
]:
...
...
@@ -35,4 +37,13 @@ def test_true_division():
else
:
raise
TestFailed
(
"expected OverflowError from %r"
%
overflow
)
for
zero
in
[
"huge / 0"
,
"huge / 0L"
,
"mhuge / 0"
,
"mhuge / 0L"
]:
try
:
eval
(
zero
,
namespace
)
except
ZeroDivisionError
:
pass
else
:
raise
TestFailed
(
"expected ZeroDivisionError from %r"
%
zero
)
test_true_division
()
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