Check that 'd' isn't allowed as an exponent specifier in inputs to the float function.

This commit is contained in:
Mark Dickinson 2010-02-12 21:16:38 +00:00
parent 6164d7ac84
commit 876473bcc8
1 changed files with 3 additions and 0 deletions

View File

@ -104,6 +104,9 @@ class GeneralFloatCases(unittest.TestCase):
self.assertRaises(ValueError, float, "+-3.14")
self.assertRaises(ValueError, float, "-+3.14")
self.assertRaises(ValueError, float, "--3.14")
# check that we don't accept alternate exponent markers
self.assertRaises(ValueError, float, "-1.7d29")
self.assertRaises(ValueError, float, "3D-14")
if test_support.have_unicode:
self.assertEqual(float(unicode(" 3.14 ")), 3.14)
self.assertEqual(float(unicode(" \u0663.\u0661\u0664 ",'raw-unicode-escape')), 3.14)