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
d256271c
Commit
d256271c
authored
Aug 30, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a regression test for the negation-of-exponentiation optimization
bug from compile.c. (SF bug #456756.)
parent
14ef244d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
Lib/test/test_pow.py
Lib/test/test_pow.py
+11
-0
No files found.
Lib/test/test_pow.py
View file @
d256271c
import
sys
import
test_support
from
test_support
import
verify
def
powtest
(
type
):
if
type
!=
float
:
print
" Testing 2-argument pow() function..."
...
...
@@ -76,6 +79,14 @@ powtest(long)
print
'Testing floating point mode...'
powtest
(
float
)
# Make sure '**' does the right thing; these form a
# regression test for SourceForge bug #456756.
#
verify
((
-
2
**
2
)
==
-
4
,
"expected '-2 ** 2' to be -4, got %s"
%
(
-
2
**
2
))
verify
(((
-
2
)
**
2
)
==
4
,
"expected '(-2) ** 2' to be 4, got %s"
%
((
-
2
)
**
2
))
# Other tests-- not very systematic
print
'The number in both columns should match.'
...
...
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