diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-26 05:10:46 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-26 05:10:46 +0000 |
commit | a8cb9b02a0ad6c9bb656ce5154c5483de36f5b12 (patch) | |
tree | 555909c564464258db2d0b1424c26e177d084525 /test | |
parent | 651b394a12fba26b9c64676978f9b2b3205c0b14 (diff) | |
download | ruby-a8cb9b02a0ad6c9bb656ce5154c5483de36f5b12.tar.gz |
eval.c: preserve encoding
* eval.c (setup_exception): preserve exception class name encoding
in debug mode messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_exception.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index ffcee80ca3..aabe1464b1 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -100,6 +100,23 @@ class TestException < Test::Unit::TestCase assert_include(err, bug9568.to_s) end + def test_errinfo_encoding_in_debug + exc = Module.new {break class_eval("class C\u{30a8 30e9 30fc} < RuntimeError; self; end".encode(Encoding::EUC_JP))} + exc.inspect + + err = EnvUtil.verbose_warning do + assert_raise(exc) do + $DEBUG, debug = true, $DEBUG + begin + raise exc + ensure + $DEBUG = debug + end + end + end + assert_include(err, exc.to_s) + end + def test_break_ensure bad = true while true |