diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-05-26 19:06:33 +0000 |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-05-26 19:06:33 +0000 |
commit | 784a47f2c0fcdee61518407900baa1e08025182b (patch) | |
tree | 7ba7b303abfe7b1093e31ed86ada8d3cfeb9a812 /Lib/test/test_int.py | |
parent | 708c0727f9067cbf88f970f080125b7ec3128e24 (diff) | |
download | cpython-git-784a47f2c0fcdee61518407900baa1e08025182b.tar.gz |
Issue #8825: additional testcases for int(string, 0) and long(string, 0).
Diffstat (limited to 'Lib/test/test_int.py')
-rw-r--r-- | Lib/test/test_int.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py index ec57842b68..6e611c2cc9 100644 --- a/Lib/test/test_int.py +++ b/Lib/test/test_int.py @@ -175,6 +175,12 @@ class IntTestCases(unittest.TestCase): self.assertEqual(int(' 0O123 ', 0), 83) self.assertEqual(int(' 0X123 ', 0), 291) self.assertEqual(int(' 0B100 ', 0), 4) + self.assertEqual(int('0', 0), 0) + self.assertEqual(int('+0', 0), 0) + self.assertEqual(int('-0', 0), 0) + self.assertEqual(int('00', 0), 0) + self.assertRaises(ValueError, int, '08', 0) + self.assertRaises(ValueError, int, '-012395', 0) # without base still base 10 self.assertEqual(int('0123'), 123) |