mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Merged revisions 73715 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
This commit is contained in:
parent
ef82be368a
commit
ab91fdef1f
274 changed files with 4538 additions and 4538 deletions
|
@ -38,9 +38,9 @@ class TokenTests(unittest.TestCase):
|
|||
if maxsize == 2147483647:
|
||||
self.assertEquals(-2147483647-1, -0o20000000000)
|
||||
# XXX -2147483648
|
||||
self.assert_(0o37777777777 > 0)
|
||||
self.assert_(0xffffffff > 0)
|
||||
self.assert_(0b1111111111111111111111111111111 > 0)
|
||||
self.assertTrue(0o37777777777 > 0)
|
||||
self.assertTrue(0xffffffff > 0)
|
||||
self.assertTrue(0b1111111111111111111111111111111 > 0)
|
||||
for s in ('2147483648', '0o40000000000', '0x100000000',
|
||||
'0b10000000000000000000000000000000'):
|
||||
try:
|
||||
|
@ -49,9 +49,9 @@ class TokenTests(unittest.TestCase):
|
|||
self.fail("OverflowError on huge integer literal %r" % s)
|
||||
elif maxsize == 9223372036854775807:
|
||||
self.assertEquals(-9223372036854775807-1, -0o1000000000000000000000)
|
||||
self.assert_(0o1777777777777777777777 > 0)
|
||||
self.assert_(0xffffffffffffffff > 0)
|
||||
self.assert_(0b11111111111111111111111111111111111111111111111111111111111111 > 0)
|
||||
self.assertTrue(0o1777777777777777777777 > 0)
|
||||
self.assertTrue(0xffffffffffffffff > 0)
|
||||
self.assertTrue(0b11111111111111111111111111111111111111111111111111111111111111 > 0)
|
||||
for s in '9223372036854775808', '0o2000000000000000000000', \
|
||||
'0x10000000000000000', \
|
||||
'0b100000000000000000000000000000000000000000000000000000000000000':
|
||||
|
@ -87,15 +87,15 @@ class TokenTests(unittest.TestCase):
|
|||
x = 3.1e4
|
||||
|
||||
def testStringLiterals(self):
|
||||
x = ''; y = ""; self.assert_(len(x) == 0 and x == y)
|
||||
x = '\''; y = "'"; self.assert_(len(x) == 1 and x == y and ord(x) == 39)
|
||||
x = '"'; y = "\""; self.assert_(len(x) == 1 and x == y and ord(x) == 34)
|
||||
x = ''; y = ""; self.assertTrue(len(x) == 0 and x == y)
|
||||
x = '\''; y = "'"; self.assertTrue(len(x) == 1 and x == y and ord(x) == 39)
|
||||
x = '"'; y = "\""; self.assertTrue(len(x) == 1 and x == y and ord(x) == 34)
|
||||
x = "doesn't \"shrink\" does it"
|
||||
y = 'doesn\'t "shrink" does it'
|
||||
self.assert_(len(x) == 24 and x == y)
|
||||
self.assertTrue(len(x) == 24 and x == y)
|
||||
x = "does \"shrink\" doesn't it"
|
||||
y = 'does "shrink" doesn\'t it'
|
||||
self.assert_(len(x) == 24 and x == y)
|
||||
self.assertTrue(len(x) == 24 and x == y)
|
||||
x = """
|
||||
The "quick"
|
||||
brown fox
|
||||
|
@ -128,7 +128,7 @@ the \'lazy\' dog.\n\
|
|||
|
||||
def testEllipsis(self):
|
||||
x = ...
|
||||
self.assert_(x is Ellipsis)
|
||||
self.assertTrue(x is Ellipsis)
|
||||
self.assertRaises(SyntaxError, eval, ".. .")
|
||||
|
||||
class GrammarTests(unittest.TestCase):
|
||||
|
@ -494,7 +494,7 @@ class GrammarTests(unittest.TestCase):
|
|||
nonlocal x, y
|
||||
|
||||
def testAssert(self):
|
||||
# assert_stmt: 'assert' test [',' test]
|
||||
# assertTruestmt: 'assert' test [',' test]
|
||||
assert 1
|
||||
assert 1, 1
|
||||
assert lambda x:x
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue