summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_module.rb4
-rw-r--r--test/ruby/test_string.rb6
2 files changed, 6 insertions, 4 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 75fd81247a..0bb27be968 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -609,7 +609,7 @@ class TestModule < Test::Unit::TestCase
assert_raise(TypeError, bug5084) { c1.const_get(1) }
bug7574 = '[ruby-dev:46749]'
e = assert_raise(NameError) { Object.const_get("String\0") }
- assert_equal("wrong constant name \"String\\000\"", e.message, bug7574)
+ assert_equal("wrong constant name \"String\\u0000\"", e.message, bug7574)
end
def test_const_defined_invalid_name
@@ -619,7 +619,7 @@ class TestModule < Test::Unit::TestCase
assert_raise(TypeError, bug5084) { c1.const_defined?(1) }
bug7574 = '[ruby-dev:46749]'
e = assert_raise(NameError) { Object.const_defined?("String\0") }
- assert_equal("wrong constant name \"String\\000\"", e.message, bug7574)
+ assert_equal("wrong constant name \"String\\u0000\"", e.message, bug7574)
end
def test_const_get_no_inherited
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index f1ed82a4dd..651ab7c90c 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -1986,9 +1986,11 @@ class TestString < Test::Unit::TestCase
end
def test_inspect_nul
+ bug8290 = '[ruby-core:54458]'
s = "\0" + "12"
- assert_not_equal '"\\012"', eval(s.inspect)
- assert_equal s, eval(s.inspect)
+ assert_equal '"\u000012"', s.inspect, bug8290
+ s = "\0".b + "12"
+ assert_equal '"\x0012"', s.inspect, bug8290
end
def test_partition