]> granicus.if.org Git - python/commitdiff
Test long inputs to float
authorMark Dickinson <dickinsm@gmail.com>
Tue, 27 Oct 2009 22:09:33 +0000 (22:09 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Tue, 27 Oct 2009 22:09:33 +0000 (22:09 +0000)
Lib/test/test_float.py

index 9d0c69d4c063cbdcb303e06f151f42574e5f58a1..86dae3f690a47e7156c4aec54696ab137097793d 100644 (file)
@@ -32,6 +32,11 @@ class GeneralFloatCases(unittest.TestCase):
             self.assertEqual(float(unicode("  3.14  ")), 3.14)
             self.assertEqual(float(unicode("  \u0663.\u0661\u0664  ",'raw-unicode-escape')), 3.14)
 
+        # extra long strings should no longer be a problem
+        # (in 2.6, long unicode inputs to float raised ValueError)
+        float('.' + '1'*1000)
+        float(unicode('.' + '1'*1000))
+
     @test_support.run_with_locale('LC_NUMERIC', 'fr_FR', 'de_DE')
     def test_float_with_comma(self):
         # set locale to something that doesn't use '.' for the decimal point