summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mrbgems/mruby-string-utf8/test/string.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/mrbgems/mruby-string-utf8/test/string.rb b/mrbgems/mruby-string-utf8/test/string.rb
index bfa5f0170..325c6eb39 100644
--- a/mrbgems/mruby-string-utf8/test/string.rb
+++ b/mrbgems/mruby-string-utf8/test/string.rb
@@ -30,3 +30,10 @@ assert('Invalid sequence') do
assert_equal 5, "\xF8\x88\x80\x80\x80".size
assert_equal 6, "\xFC\x84\x80\x80\x80\x80".size
end
+
+assert('String#size') do
+ str = 'こんにちわ世界!'
+ assert_equal 8, str.size
+ assert_not_equal str.bytesize, str.size
+ assert_equal 2, str[1, 2].size
+end