From b69f9fa31f976cac4cdcb441612c8a72b10af457 Mon Sep 17 00:00:00 2001 From: Dave Hylands Date: Thu, 5 Jun 2014 23:09:02 -0700 Subject: Fix str.modulo when precision is specified. --- tests/basics/string-format-modulo.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tests/basics/string-format-modulo.py') diff --git a/tests/basics/string-format-modulo.py b/tests/basics/string-format-modulo.py index c8fdc06f68..f3f57b45ad 100644 --- a/tests/basics/string-format-modulo.py +++ b/tests/basics/string-format-modulo.py @@ -51,8 +51,18 @@ print("%#06x" % 18) print("%*d" % (5, 10)) print("%*.*d" % (2, 2, 20)) -# TODO: Formatted incorrectly -#print("%*.*d" % (5, 8, 20)) +print("%*.*d" % (5, 8, 20)) + +print(">%8.4d<" % -12) +print(">% 8.4d<" % -12) +print(">%+8.4d<" % 12) +print(">%+8.4d<" % -12) +print(">%08.4d<" % -12) +print(">%08.4d<" % 12) +print(">%-8.4d<" % -12) +print(">%-08.4d<" % -12) +print(">%-+08.4d<" % -12) +print(">%-+08.4d<" % 12) # Cases when "*" used and there's not enough values total try: -- cgit v1.2.3