[Bug #18956] Negative codepoints are invalid characters

This commit is contained in:
Nobuyoshi Nakada 2022-08-20 01:43:04 +09:00
parent 8f4a53d051
commit d2483393cb
Notes: git 2022-08-20 10:06:37 +09:00
2 changed files with 3 additions and 2 deletions

View file

@ -368,6 +368,7 @@ class TestSprintf < Test::Unit::TestCase
assert_equal(" " * (BSIZ - 1) + "a", sprintf(" " * (BSIZ - 1) + "%-1c", ?a))
assert_equal(" " * BSIZ + "a", sprintf("%#{ BSIZ + 1 }c", ?a))
assert_equal("a" + " " * BSIZ, sprintf("%-#{ BSIZ + 1 }c", ?a))
assert_raise(ArgumentError) { sprintf("%c", -1) }
end
def test_string