1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

add a test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-01-06 02:17:18 +00:00
parent 84a92191e3
commit ebe7d94ca6

View file

@ -721,6 +721,13 @@ class TestM17N < Test::Unit::TestCase
s = "abc".force_encoding(Encoding::ASCII_8BIT)
t = s.gsub(/b/, "\xa1\xa1".force_encoding("euc-jp"))
assert_equal(Encoding::ASCII_8BIT, s.encoding)
assert_raise(ArgumentError) {
"abc".gsub(/[ac]/) {
$& == "a" ? "\xc2\xa1".force_encoding("euc-jp") :
"\xc2\xa1".force_encoding("utf-8")
}
}
end
def test_regexp_match