diff options
author | Dave Hylands <dhylands@gmail.com> | 2014-06-05 23:09:02 -0700 |
---|---|---|
committer | Dave Hylands <dhylands@gmail.com> | 2014-06-05 23:09:02 -0700 |
commit | b69f9fa31f976cac4cdcb441612c8a72b10af457 (patch) | |
tree | dcd3d480a4099e5d3205a2ed132df534fc61b024 /tests/basics/string-format-modulo.py | |
parent | 380f147d2e39904641e280ab19f8f77daf3c5be3 (diff) | |
download | micropython-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.py | 14 |
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: |