From 4191a6b90d3eeb63a31609dba29a1904efee3738 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 28 Sep 2015 02:40:46 +0000 Subject: preserve encodings in error messages git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_complex.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/ruby/test_complex.rb') diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb index 8da0e51644..de3bb05d6c 100644 --- a/test/ruby/test_complex.rb +++ b/test/ruby/test_complex.rb @@ -427,6 +427,9 @@ class Complex_Test < Test::Unit::TestCase assert_equal([Complex(Rational(2)),Complex(1)], Complex(1).coerce(Rational(2))) assert_equal([Complex(2),Complex(1)], Complex(1).coerce(Complex(2))) + + obj = eval("class C\u{1f5ff}; self; end").new + assert_raise_with_message(TypeError, /C\u{1f5ff}/) { Complex(1).coerce(obj) } end class ObjectX -- cgit v1.2.3