compar.c: preserve encodings

* compar.c (rb_cmperr): preserve encodings of arguments in the
  message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-08-19 04:59:44 +00:00
parent f9b7a2a33f
commit 40db3d97ac
3 changed files with 14 additions and 6 deletions

View file

@ -73,6 +73,10 @@ class TestComparable < Test::Unit::TestCase
def test_err
assert_raise(ArgumentError) { 1.0 < nil }
assert_raise(ArgumentError) { 1.0 < Object.new }
e = Module.new {break module_eval("class E\u{30a8 30e9 30fc}; self; end")}
assert_raise_with_message(ArgumentError, /E\u{30a8 30e9 30fc}/) {
1.0 < e.new
}
end
def test_inversed_compare