diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-23 00:52:17 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-23 00:52:17 +0000 |
commit | ade2ba57a2659600a5cc2987461538bebeed8f5e (patch) | |
tree | dcf3e63cd93a1c5634b0ce5d795ecf38851d310b /test | |
parent | 1f4e5348154cd59435fca6ac18e923130309fdd8 (diff) | |
download | ruby-ade2ba57a2659600a5cc2987461538bebeed8f5e.tar.gz |
* string.c (rb_str_inspect): NUL should not be represented as
"\0" when octal digits may follow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_string.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 4d9f7d95b0..f1ed82a4dd 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -1985,6 +1985,12 @@ class TestString < Test::Unit::TestCase assert_instance_of(String, s.to_s) end + def test_inspect_nul + s = "\0" + "12" + assert_not_equal '"\\012"', eval(s.inspect) + assert_equal s, eval(s.inspect) + end + def test_partition assert_equal(%w(he l lo), "hello".partition(/l/)) assert_equal(%w(he l lo), "hello".partition("l")) |