diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-13 03:49:46 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-13 03:49:46 +0000 |
commit | dd2a86cf115d7e23673c75ba9f28f2699a1443f1 (patch) | |
tree | 0366d85e5b8cd2dc2ea4fd6d2d60b10491065fd2 /test/ruby/test_m17n.rb | |
parent | 3b1a65add329a757be6679282d3d3206e58cff2e (diff) | |
download | ruby-dd2a86cf115d7e23673c75ba9f28f2699a1443f1.tar.gz |
* test/ruby/test_m17n.rb: feature changed in r20626.
follows it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_m17n.rb')
-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) |