From cb4472df42e6f34df2fe57f4f85786f6669171f7 Mon Sep 17 00:00:00 2001 From: Yonatan Goldschmidt Date: Wed, 22 Jan 2020 20:53:54 +0100 Subject: tests: Add boolean-as-integer formatting tests for fixed regression. As suggested by @dpgeorge in #5538. --- tests/basics/string_format.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/basics/string_format.py') diff --git a/tests/basics/string_format.py b/tests/basics/string_format.py index 8b2592406..e8600f583 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')) -- cgit v1.2.3