Update the Fixnum#chr test for UTF-8.

This commit is contained in:
chasonr
2014-02-26 20:53:23 -05:00
parent 5e5ee841a1
commit b752b01a56
+7 -2
View File
@@ -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