diff options
author | Yonatan Goldschmidt <yon.goldschmidt@gmail.com> | 2020-01-22 20:53:54 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-01-24 10:57:17 +1100 |
commit | cb4472df42e6f34df2fe57f4f85786f6669171f7 (patch) | |
tree | c2cd4e726b3e1799b6ab170e5c7b4e2c96275b8a /tests/basics/string_format.py | |
parent | 35e664d7790b123dab54faff766f41991f4620d1 (diff) | |
download | micropython-cb4472df42e6f34df2fe57f4f85786f6669171f7.tar.gz micropython-cb4472df42e6f34df2fe57f4f85786f6669171f7.zip |
tests: Add boolean-as-integer formatting tests for fixed regression.
As suggested by @dpgeorge in #5538.
Diffstat (limited to 'tests/basics/string_format.py')
-rw-r--r-- | tests/basics/string_format.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/basics/string_format.py b/tests/basics/string_format.py index 8b25924067..e8600f5836 100644 --- a/tests/basics/string_format.py +++ b/tests/basics/string_format.py @@ -63,6 +63,12 @@ test("{:>20}", "foo") test("{:^20}", "foo") test("{:<20}", "foo") +# formatting bool as int +test('{:d}', False) +test('{:20}', False) +test('{:d}', True) +test('{:20}', True) + # nested format specifiers print("{:{}}".format(123, '#>10')) print("{:{}{}{}}".format(123, '#', '>', '10')) |