summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-13 03:49:46 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-13 03:49:46 +0000
commitae02616c2e27db2df1809a9599d4d09c8b1302de (patch)
tree0366d85e5b8cd2dc2ea4fd6d2d60b10491065fd2 /test
parent0f5d079571e359e843bd9528ba5a9bc1979f37d1 (diff)
downloadruby-ae02616c2e27db2df1809a9599d4d09c8b1302de.tar.gz
ruby-ae02616c2e27db2df1809a9599d4d09c8b1302de.tar.xz
ruby-ae02616c2e27db2df1809a9599d4d09c8b1302de.zip
* test/ruby/test_m17n.rb: feature changed in r20626.
follows it. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_m17n.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 416d8e190..4b7543f3e 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)