summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_format.py
diff options
context:
space:
mode:
authorEric Smith <eric@trueblade.com>2008-07-17 18:30:48 (GMT)
committerEric Smith <eric@trueblade.com>2008-07-17 18:30:48 (GMT)
commita4fac36eb3ee70529482d43d2a484d5ff5d18398 (patch)
treef28ae6605017ff42d83cdf78978391b4c7237079 /Lib/test/test_format.py
parentddc5669fd90135ba345a9f1a98a11c67a97f833e (diff)
downloadcpython-a4fac36eb3ee70529482d43d2a484d5ff5d18398.zip
cpython-a4fac36eb3ee70529482d43d2a484d5ff5d18398.tar.gz
cpython-a4fac36eb3ee70529482d43d2a484d5ff5d18398.tar.bz2
Merged revisions 65069 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r65069 | eric.smith | 2008-07-17 13:48:39 -0400 (Thu, 17 Jul 2008) | 1 line Issue 3382: Make '%F' and float.__format__('F') convert results to upper case. ........
Diffstat (limited to 'Lib/test/test_format.py')
-rw-r--r--Lib/test/test_format.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index 6d32e86..30b07d8 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -79,6 +79,17 @@ class FormatTest(unittest.TestCase):
testformat("%#.*f", (110, -1.e+100/3.))
testformat("%#.*F", (110, -1.e+100/3.))
overflowrequired = 0
+ # check for %f and %F
+ testformat("%f", (1.0,), "1.000000")
+ testformat("%F", (1.0,), "1.000000")
+ testformat("%f", (1e100,), "1e+100")
+ testformat("%F", (1e100,), "1E+100")
+ testformat("%f", (1e100,), "1e+100")
+ testformat("%F", (1e100,), "1E+100")
+ testformat("%f", (float('nan'),), "nan")
+ testformat("%F", (float('nan'),), "NAN")
+ testformat("%f", (float('inf'),), "inf")
+ testformat("%F", (float('inf'),), "INF")
# Formatting of integers. Overflow is not ok
overflowok = 0
testformat("%x", 10, "a")