summaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-20 13:51:32 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-20 13:51:32 +0000
commit2a677d82f11ff0973e8cb1b23255a182350a3880 (patch)
treea3b2cf7272ac31c78a2d80d59686266f958a59b1 /test/ruby
parent20181d8f205a992781c0549d4ebb862c02254c8e (diff)
downloadruby-2a677d82f11ff0973e8cb1b23255a182350a3880.tar.gz
ruby-2a677d82f11ff0973e8cb1b23255a182350a3880.tar.xz
ruby-2a677d82f11ff0973e8cb1b23255a182350a3880.zip
add a test for each_char.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_m17n.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 6cffcdd4f..2df720322 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -852,6 +852,12 @@ class TestM17N < Test::Unit::TestCase
assert_equal(false, s1.end_with?(s2), "#{encdump s1}.end_with?(#{encdump s2})")
end
+ def test_each_char
+ a = [e("\xa4\xa2"), "b", e("\xa4\xa4"), "c"]
+ s = "\xa4\xa2b\xa4\xa4c".force_encoding("euc-jp")
+ assert_equal(a, s.each_char.to_a, "[ruby-dev:33211] #{encdump s}.each_char.to_a")
+ end
+
def test_regexp_match
assert_equal([0,0], //.match("\xa1\xa1".force_encoding("euc-jp"),-1).offset(0))
end