diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-01-07 14:31:12 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-01-07 14:31:12 +0900 |
| commit | 0f7d771adc76d4844a1c953446ccc785c141c017 (patch) | |
| tree | d2727ffe7cd3eca82f3db9683d8ac3ee499d8034 /mrbgems/mruby-string-utf8/test/string.rb | |
| parent | 65f6b105e940b315d8b1ce76b54a5e92a4905ac0 (diff) | |
| parent | 055468bfa0d97edce5b1c4ae5d9847349cb4fee5 (diff) | |
| download | mruby-0f7d771adc76d4844a1c953446ccc785c141c017.tar.gz mruby-0f7d771adc76d4844a1c953446ccc785c141c017.zip | |
Merge branch 'mruby-string-utf8' of https://github.com/mattn/mruby into mattn-mruby-string-utf8
Diffstat (limited to 'mrbgems/mruby-string-utf8/test/string.rb')
| -rw-r--r-- | mrbgems/mruby-string-utf8/test/string.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mrbgems/mruby-string-utf8/test/string.rb b/mrbgems/mruby-string-utf8/test/string.rb new file mode 100644 index 000000000..8d6d0f109 --- /dev/null +++ b/mrbgems/mruby-string-utf8/test/string.rb @@ -0,0 +1,12 @@ +## +# String(utf8) Test + +assert('String#[]') do + assert_equal "ち", "こんにちわ世界"[3] + assert_equal nil, "こんにちわ世界"[20] + assert_equal "世", "こんにちわ世界"[-2] + assert_equal "世界", "こんにちわ世界"[-2..-1] + assert_equal "んに", "こんにちわ世界"[1,2] + assert_equal "世", "こんにちわ世界"["世"] + assert_equal "世", "こんにちわ世界"["世"] +end |
