[Python-checkins] CVS: python/dist/src/Lib/test test_pow.py,1.9,1.10 test_unary.py,1.2,1.3
Fred L. Drake
fdrake@users.sourceforge.net
Thu, 30 Aug 2001 12:15:22 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv13624
Modified Files:
test_pow.py test_unary.py
Log Message:
Revert the previous patch to test_pow.py and move the test to test_unary.py
based on a suggestion from Tim Peters; also make sure that we're really
doing exponentiation and not multiplication.
Index: test_pow.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pow.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** test_pow.py 2001/08/30 18:56:30 1.9
--- test_pow.py 2001/08/30 19:15:20 1.10
***************
*** 2,7 ****
import test_support
- from test_support import verify
-
def powtest(type):
--- 2,5 ----
***************
*** 79,90 ****
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
--- 77,80 ----
Index: test_unary.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unary.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_unary.py 2001/08/27 21:45:32 1.2
--- test_unary.py 2001/08/30 19:15:20 1.3
***************
*** 34,37 ****
--- 34,45 ----
self.assert_(eval("~" + nines) == eval("~" + nines + "L"))
+ def test_negation_of_exponentiation(self):
+ # Make sure '**' does the right thing; these form a
+ # regression test for SourceForge bug #456756.
+ self.assertEqual(-2 ** 3, -8)
+ self.assertEqual((-2) ** 3, -8)
+ self.assertEqual(-2 ** 4, -16)
+ self.assertEqual((-2) ** 4, 16)
+
def test_bad_types(self):
for op in '+', '-', '~':