[pypy-svn] pypy shorter-float-repr: More tests for dtoa

amauryfa commits-noreply at bitbucket.org
Mon Jan 24 18:35:24 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: shorter-float-repr
Changeset: r41264:acae239dc710
Date: 2011-01-24 18:04 +0100
http://bitbucket.org/pypy/pypy/changeset/acae239dc710/

Log:	More tests for dtoa

diff --git a/pypy/rlib/test/test_rdtoa.py b/pypy/rlib/test/test_rdtoa.py
--- a/pypy/rlib/test/test_rdtoa.py
+++ b/pypy/rlib/test/test_rdtoa.py
@@ -6,6 +6,7 @@
     assert strtod("1.1") == 1.1
     assert strtod("3.47") == 3.47
     raises(ValueError, strtod, "123A")
+    assert strtod(".125") == .125
 
 def test_dtoa():
     assert dtoa(3.47) == "3.47"
@@ -22,3 +23,4 @@
 
 def test_dtoa_precision():
     assert dtoa(1.1, code='f', precision=2) == "1.10"
+    assert dtoa(1e12, code='g', precision=12) == "1e+12"


More information about the Pypy-commit mailing list