diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-02 16:53:02 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-02 16:53:02 +0000 |
commit | c6816d074b89131797e842a312f302037bcfbb9c (patch) | |
tree | 608dbc9a13d6c8839cbc37a86b0f848ce3151ad1 /test | |
parent | 6df2fbf0f6c4efa68865bec69598894f89d61d0b (diff) |
merge revision(s) r41598,r45181:
* eval_error.c (warn_printf): use rb_vsprintf instead so ruby specific
extensions like PRIsVALUE can be used in format strings
* eval_error.c (error_print): use warn_print_str (alias for
rb_write_error_str) to print a string value instead of using
RSTRING_PTR and RSTRING_LEN manually
* eval.c (setup_exception): use PRIsVALUE instead of %s and RSTRING_PTR
* eval.c (setup_exception): preserve exception class name encoding
in debug mode messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@45253 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 123eecc602..ea733b3add 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -102,6 +102,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 |