summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-22 15:04:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-22 15:04:57 +0000
commit6f02547d83ec4651999b55f606672084cb0fe22b (patch)
tree33670755b21e35cdb937e083360465712d75b76a /test/ruby
parent1df33a4a5f4bb1b2393cf5597e7d1156983c7741 (diff)
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
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_module.rb8
1 files changed, 6 insertions, 2 deletions
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