diff --git a/tests/float/string_format.py b/tests/float/string_format.py index 265efedec57417a8b4de481122bded8caa9377bf..9ffbec4ff7a75adacde4443da5742c07e2288898 100644 --- a/tests/float/string_format.py +++ b/tests/float/string_format.py @@ -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) diff --git a/tests/float/string_format_modulo.py b/tests/float/string_format_modulo.py index 11df9abbd25915b861d68228fd90241e84238b18..03b178703f862e39da7851789d627fa3ab4f3080 100644 --- a/tests/float/string_format_modulo.py +++ b/tests/float/string_format_modulo.py @@ -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