mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Update the Fixnum#chr test for UTF-8.
This commit is contained in:
@@ -5,6 +5,11 @@ assert('Integer#chr') do
|
||||
assert_equal("A", 65.chr)
|
||||
assert_equal("B", 0x42.chr)
|
||||
|
||||
# multibyte encoding (not support yet)
|
||||
assert_raise(RangeError) { 12345.chr }
|
||||
if 255.chr.bytes == [195, 191] then
|
||||
# UTF-8 gem is configured
|
||||
assert_raise(RangeError) { 0x110000.chr }
|
||||
else
|
||||
# multibyte encoding (not support yet)
|
||||
assert_raise(RangeError) { 256.chr }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user