From a5fadaadd368d0a96d7e3bc3edfdc92ae22f44ce Mon Sep 17 00:00:00 2001 From: naruse Date: Tue, 23 Apr 2013 12:24:56 +0000 Subject: * string.c (rb_str_inspect): refix r40413, on Ruby 1.9 usual character escape uses hex/Unicode escapes, so fix to use Unicode escape on Unicode strings and hex on others. [ruby-core:54458] [Bug #8290] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_string.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/ruby/test_string.rb') 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 -- cgit v1.2.3