From 6f02547d83ec4651999b55f606672084cb0fe22b Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 22 Dec 2012 15:04:57 +0000 Subject: internal.h: quote unprintable * internal.h (QUOTE, QUOTE_ID): quote unprintable chars in strings and IDs. [Bug #7574] [ruby-dev:46749] * string.c (rb_str_quote_unprintable): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_module.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 8afb34ae78..52f643489c 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -588,7 +588,9 @@ class TestModule < Test::Unit::TestCase assert_raise(NameError) { c1.const_get(:foo) } bug5084 = '[ruby-dev:44200]' assert_raise(TypeError, bug5084) { c1.const_get(1) } - assert_raise(NameError) { Object.const_get("String\0") } + bug7574 = '[ruby-dev:46749]' + e = assert_raise(NameError) { Object.const_get("String\0") } + assert_equal("wrong constant name \"String\\0\"", e.message, bug7574) end def test_const_defined_invalid_name @@ -596,7 +598,9 @@ class TestModule < Test::Unit::TestCase assert_raise(NameError) { c1.const_defined?(:foo) } bug5084 = '[ruby-dev:44200]' assert_raise(TypeError, bug5084) { c1.const_defined?(1) } - assert_raise(NameError) { Object.const_defined?("String\0") } + bug7574 = '[ruby-dev:46749]' + e = assert_raise(NameError) { Object.const_defined?("String\0") } + assert_equal("wrong constant name \"String\\0\"", e.message, bug7574) end def test_const_get_no_inherited -- cgit v1.2.3