summaryrefslogtreecommitdiff
path: root/test/ruby/test_m17n.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-05 19:34:15 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-05 19:34:15 +0000
commit98cbcf1bd7909306d2ba542aaff2eceb71ccb5c1 (patch)
treef11be1c581b236746c37c811bf9a858fa5491b3d /test/ruby/test_m17n.rb
parent579f16d9851fc220a1dda9a0d65e611cc37aeb14 (diff)
* string.c (count_utf8_lead_bytes_with_ulong): fix shift size.
[ruby-dev:33993] * string.c (str_utf8_nth) fix wrong counting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_m17n.rb')
-rw-r--r--test/ruby/test_m17n.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 069554a127..7a9e24f4a1 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -810,6 +810,17 @@ class TestM17N < Test::Unit::TestCase
assert_equal(false, str[0..-1].ascii_only?)
end
+ def test_utf8str_aref
+ s = "abcdefghijklmnopqrstuvwxyz\u{3042 3044 3046 3048 304A}"
+ assert_equal("a", s[0])
+ assert_equal("h", s[7])
+ assert_equal("i", s[8])
+ assert_equal("j", s[9])
+ assert_equal("\u{3044}", s[27])
+ assert_equal("\u{3046}", s[28])
+ assert_equal("\u{3048}", s[29])
+ end
+
def test_str_aref_len
assert_equal(a("\xa1"), a("\xc2\xa1\xc2\xa2\xc2\xa3")[1, 1])
assert_equal(a("\xa1\xc2"), a("\xc2\xa1\xc2\xa2\xc2\xa3")[1, 2])