Skip to content
Snippets Groups Projects
Commit 9ede4dcf authored by Damien George's avatar Damien George
Browse files

tests: Add some tests for printing floats to improve coverage.

parent 79474c6b
No related branches found
No related tags found
No related merge requests found
......@@ -122,6 +122,9 @@ if full_tests:
test_fmt('', fill, alignment, sign, '', width, prec, type, num)
for num in pct_nums2:
test_fmt('', fill, alignment, sign, '', width, '', type, num)
else:
for num in pct_nums1:
test_fmt('', '', '', '', '', '', '1', '%', num)
# We don't currently test a type of '' with floats (see the detailed comment
# in objstr.c)
......@@ -21,3 +21,8 @@ print("%G" % 1.23456)
print("%06e" % float("inf"))
print("%06e" % float("-inf"))
print("%06e" % float("nan"))
print("%02.3d" % 123) # prec > width
print("%+f %+f" % (1.23, -1.23)) # float sign
print("% f % f" % (1.23, -1.23)) # float space sign
print("%0f" % -1.23) # negative number with 0 padding
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment