mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 00:54:01 +02:00
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
This commit is contained in:
parent
651b394a12
commit
a8cb9b02a0
3 changed files with 27 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue