Add test for String#ord, String#split for mruby-string-utf8

This commit is contained in:
mattn
2014-04-18 21:00:59 +09:00
parent 4918e5ec65
commit 1d5e100e07
+6
View File
@@ -45,3 +45,9 @@ assert('String#index') do
assert_equal 12, str.index('ち', 10)
assert_equal nil, str.index("")
end
assert('String#ord') do
got = "こんにちわ世界!".split('').map {|x| x.ord}
expect = [0x3053,0x3093,0x306b,0x3061,0x308f,0x4e16,0x754c,0x21]
assert_equal expect, got
end