diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-13 04:06:28 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-13 04:06:28 +0000 |
commit | 65b69d26b21e6a260e0672a0d8a1177ac01e74f6 (patch) | |
tree | 0ff870d44793b53c62430690c32831b98274993a /test/ruby | |
parent | 87ab5ecc1318d959bc5cc2a3774e29093ec7994d (diff) |
merges r20714 from trunk into ruby_1_9_1.
* test/ruby/test_m17n.rb: feature changed in r20626.
follows it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_m17n.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index 416d8e190c..4b7543f3e9 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -48,7 +48,7 @@ class TestM17N < Test::Unit::TestCase if enc == r.encoding assert_nothing_raised { r =~ "\xc2\xa1".force_encoding(enc) } else - assert_raise(ArgumentError) { r =~ "\xc2\xa1".force_encoding(enc) } + assert_raise(Encoding::CompatibilityError) { r =~ "\xc2\xa1".force_encoding(enc) } end } end @@ -385,9 +385,9 @@ class TestM17N < Test::Unit::TestCase assert_equal(nil, r =~ s("a")) assert_equal(nil, r =~ u("a")) assert_equal(0, r =~ a("\xc2\xa1")) - assert_raise(ArgumentError) { r =~ e("\xc2\xa1") } - assert_raise(ArgumentError) { r =~ s("\xc2\xa1") } - assert_raise(ArgumentError) { r =~ u("\xc2\xa1") } + assert_raise(Encoding::CompatibilityError) { r =~ e("\xc2\xa1") } + assert_raise(Encoding::CompatibilityError) { r =~ s("\xc2\xa1") } + assert_raise(Encoding::CompatibilityError) { r =~ u("\xc2\xa1") } } end @@ -402,10 +402,10 @@ class TestM17N < Test::Unit::TestCase assert_equal(0, r =~ e("a")) assert_equal(0, r =~ s("a")) assert_equal(0, r =~ u("a")) - assert_raise(ArgumentError) { r =~ a("\xc2\xa1") } + assert_raise(Encoding::CompatibilityError) { r =~ a("\xc2\xa1") } assert_equal(nil, r =~ e("\xc2\xa1")) - assert_raise(ArgumentError) { r =~ s("\xc2\xa1") } - assert_raise(ArgumentError) { r =~ u("\xc2\xa1") } + assert_raise(Encoding::CompatibilityError) { r =~ s("\xc2\xa1") } + assert_raise(Encoding::CompatibilityError) { r =~ u("\xc2\xa1") } } [/\xc2\xa1/e, eval(e(%{/\xc2\xa1/})), eval(e(%q{/\xc2\xa1/}))].each {|r| @@ -413,10 +413,10 @@ class TestM17N < Test::Unit::TestCase assert_equal(nil, r =~ e("a")) assert_equal(nil, r =~ s("a")) assert_equal(nil, r =~ u("a")) - assert_raise(ArgumentError) { r =~ a("\xc2\xa1") } + assert_raise(Encoding::CompatibilityError) { r =~ a("\xc2\xa1") } assert_equal(0, r =~ e("\xc2\xa1")) - assert_raise(ArgumentError) { r =~ s("\xc2\xa1") } - assert_raise(ArgumentError) { r =~ u("\xc2\xa1") } + assert_raise(Encoding::CompatibilityError) { r =~ s("\xc2\xa1") } + assert_raise(Encoding::CompatibilityError) { r =~ u("\xc2\xa1") } } end @@ -430,7 +430,7 @@ class TestM17N < Test::Unit::TestCase def test_regexp_windows_31j begin Regexp.new("\xa1".force_encoding("windows-31j")) =~ "\xa1\xa1".force_encoding("euc-jp") - rescue ArgumentError + rescue Encoding::CompatibilityError err = $! end assert_match(/windows-31j/i, err.message) |