mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
3b1a65add3
commit
dd2a86cf11
2 changed files with 16 additions and 11 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sat Dec 13 12:48:57 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||||
|
|
||||||
|
* test/ruby/test_m17n.rb: feature changed in r20626.
|
||||||
|
follows it.
|
||||||
|
|
||||||
Sat Dec 13 12:38:16 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
Sat Dec 13 12:38:16 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||||
|
|
||||||
* lib/minitest/test.rb (MinTest::Unit#location):
|
* lib/minitest/test.rb (MinTest::Unit#location):
|
||||||
|
|
|
@ -48,7 +48,7 @@ class TestM17N < Test::Unit::TestCase
|
||||||
if enc == r.encoding
|
if enc == r.encoding
|
||||||
assert_nothing_raised { r =~ "\xc2\xa1".force_encoding(enc) }
|
assert_nothing_raised { r =~ "\xc2\xa1".force_encoding(enc) }
|
||||||
else
|
else
|
||||||
assert_raise(ArgumentError) { r =~ "\xc2\xa1".force_encoding(enc) }
|
assert_raise(Encoding::CompatibilityError) { r =~ "\xc2\xa1".force_encoding(enc) }
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@ -385,9 +385,9 @@ class TestM17N < Test::Unit::TestCase
|
||||||
assert_equal(nil, r =~ s("a"))
|
assert_equal(nil, r =~ s("a"))
|
||||||
assert_equal(nil, r =~ u("a"))
|
assert_equal(nil, r =~ u("a"))
|
||||||
assert_equal(0, r =~ a("\xc2\xa1"))
|
assert_equal(0, r =~ a("\xc2\xa1"))
|
||||||
assert_raise(ArgumentError) { r =~ e("\xc2\xa1") }
|
assert_raise(Encoding::CompatibilityError) { r =~ e("\xc2\xa1") }
|
||||||
assert_raise(ArgumentError) { r =~ s("\xc2\xa1") }
|
assert_raise(Encoding::CompatibilityError) { r =~ s("\xc2\xa1") }
|
||||||
assert_raise(ArgumentError) { r =~ u("\xc2\xa1") }
|
assert_raise(Encoding::CompatibilityError) { r =~ u("\xc2\xa1") }
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -402,10 +402,10 @@ class TestM17N < Test::Unit::TestCase
|
||||||
assert_equal(0, r =~ e("a"))
|
assert_equal(0, r =~ e("a"))
|
||||||
assert_equal(0, r =~ s("a"))
|
assert_equal(0, r =~ s("a"))
|
||||||
assert_equal(0, r =~ u("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_equal(nil, r =~ e("\xc2\xa1"))
|
||||||
assert_raise(ArgumentError) { r =~ s("\xc2\xa1") }
|
assert_raise(Encoding::CompatibilityError) { r =~ s("\xc2\xa1") }
|
||||||
assert_raise(ArgumentError) { r =~ u("\xc2\xa1") }
|
assert_raise(Encoding::CompatibilityError) { r =~ u("\xc2\xa1") }
|
||||||
}
|
}
|
||||||
|
|
||||||
[/\xc2\xa1/e, eval(e(%{/\xc2\xa1/})), eval(e(%q{/\xc2\xa1/}))].each {|r|
|
[/\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 =~ e("a"))
|
||||||
assert_equal(nil, r =~ s("a"))
|
assert_equal(nil, r =~ s("a"))
|
||||||
assert_equal(nil, r =~ u("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_equal(0, r =~ e("\xc2\xa1"))
|
||||||
assert_raise(ArgumentError) { r =~ s("\xc2\xa1") }
|
assert_raise(Encoding::CompatibilityError) { r =~ s("\xc2\xa1") }
|
||||||
assert_raise(ArgumentError) { r =~ u("\xc2\xa1") }
|
assert_raise(Encoding::CompatibilityError) { r =~ u("\xc2\xa1") }
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -430,7 +430,7 @@ class TestM17N < Test::Unit::TestCase
|
||||||
def test_regexp_windows_31j
|
def test_regexp_windows_31j
|
||||||
begin
|
begin
|
||||||
Regexp.new("\xa1".force_encoding("windows-31j")) =~ "\xa1\xa1".force_encoding("euc-jp")
|
Regexp.new("\xa1".force_encoding("windows-31j")) =~ "\xa1\xa1".force_encoding("euc-jp")
|
||||||
rescue ArgumentError
|
rescue Encoding::CompatibilityError
|
||||||
err = $!
|
err = $!
|
||||||
end
|
end
|
||||||
assert_match(/windows-31j/i, err.message)
|
assert_match(/windows-31j/i, err.message)
|
||||||
|
|
Loading…
Add table
Reference in a new issue