diff options
Diffstat (limited to 'test/ruby/test_exception.rb')
-rw-r--r-- | test/ruby/test_exception.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 9250038264..fc1c209e99 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -221,6 +221,22 @@ class TestException < Test::Unit::TestCase assert_raise(ArgumentError) { raise 1, 1, 1, 1 } end + def test_type_error_message_encoding + c = eval("Module.new do break class C\u{4032}; self; end; end") + o = c.new + assert_raise_with_message(TypeError, /C\u{4032}/) do + ""[o] + end + c.class_eval {def to_int; self; end} + assert_raise_with_message(TypeError, /C\u{4032}/) do + ""[o] + end + c.class_eval {def to_a; self; end} + assert_raise_with_message(TypeError, /C\u{4032}/) do + [*o] + end + end + def test_errat assert_in_out_err([], "p $@", %w(nil), []) |