mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
d60944ef3a
The string is "Hello world" in Japanese. (hat tip: Google Translate.)
16 lines
337 B
Ruby
16 lines
337 B
Ruby
##
|
|
# Numeric(Ext) Test
|
|
|
|
assert('Integer#chr') do
|
|
assert_equal("A", 65.chr)
|
|
assert_equal("B", 0x42.chr)
|
|
|
|
if "こんにちわ世界".size == 7 then
|
|
# UTF-8 gem is configured
|
|
assert_raise(RangeError) { 0x110000.chr }
|
|
else
|
|
# multibyte encoding (not support yet)
|
|
assert_raise(RangeError) { 256.chr }
|
|
end
|
|
end
|