summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/string-format-modulo.py
diff options
context:
space:
mode:
authorDave Hylands <dhylands@gmail.com>2014-06-05 23:09:02 -0700
committerDave Hylands <dhylands@gmail.com>2014-06-05 23:09:02 -0700
commitb69f9fa31f976cac4cdcb441612c8a72b10af457 (patch)
treedcd3d480a4099e5d3205a2ed132df534fc61b024 /tests/basics/string-format-modulo.py
parent380f147d2e39904641e280ab19f8f77daf3c5be3 (diff)
downloadmicropython-b69f9fa31f976cac4cdcb441612c8a72b10af457.tar.gz
micropython-b69f9fa31f976cac4cdcb441612c8a72b10af457.zip
Fix str.modulo when precision is specified.
Diffstat (limited to 'tests/basics/string-format-modulo.py')
-rw-r--r--tests/basics/string-format-modulo.py14
1 files changed, 12 insertions, 2 deletions
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: