summaryrefslogtreecommitdiffstatshomepage
path: root/tests/float/string_format.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-05-28 14:22:12 +0000
committerDamien George <damien.p.george@gmail.com>2015-05-28 14:22:12 +0000
commit79474c6b164fb66a8d348bfa57613f9dbf5af4e8 (patch)
treed449229d7ee01f114d092a624943bb42d79a72a5 /tests/float/string_format.py
parent2cae0f62908812b6cd925943ee70e7e0bef0387e (diff)
downloadmicropython-79474c6b164fb66a8d348bfa57613f9dbf5af4e8.tar.gz
micropython-79474c6b164fb66a8d348bfa57613f9dbf5af4e8.zip
py: Remove unnecessary extra handling of padding of nan/inf.
C's printf will pad nan/inf differently to CPython. Our implementation originally conformed to C, now it conforms to CPython's way. Tests for this are also added in this patch.
Diffstat (limited to 'tests/float/string_format.py')
-rw-r--r--tests/float/string_format.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/float/string_format.py b/tests/float/string_format.py
index b5ff68b8ca..265efedec5 100644
--- a/tests/float/string_format.py
+++ b/tests/float/string_format.py
@@ -23,6 +23,10 @@ test("{:10.4F}", -123.456)
test("{:10.4G}", 123.456)
test("{:10.4G}", -123.456)
+test("{:06e}", float("inf"))
+test("{:06e}", float("-inf"))
+test("{:06e}", float("nan"))
+
# The following fails right now
#test("{:10.1}", 0.0)