This commit is contained in:
yt2b committed 2022-12-31 00:58:18 +09:00
1 parent e4244d62d8
commit 3741321b29
1 file changed
+6
+6
View File
@@ -29,3 +29,9 @@ assert f'{65536:,}' == '65,536'
assert f'{4294967296:,}' == '4,294,967,296'
assert 'F' == "{0:{base}}".format(15, base="X")
assert f'{255:#X}' == "0XFF"
assert f"{65:c}" == "A"
assert f"{0x1f5a5:c}" == "🖥"
assert_raises(ValueError, "{:+c}".format, 1, _msg="Sign not allowed with integer format specifier 'c'")
assert_raises(ValueError, "{:#c}".format, 1, _msg="Alternate form (#) not allowed with integer format specifier 'c'")
# TODO: raise OverflowError
assert_raises(ValueError, "{:c}".format, -1, _msg="%c arg not in range(0x110000)")