diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-28 18:04:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-28 18:04:23 +0000 |
commit | 30ab36c7dc743d584a1534c5695ba37fbfb1c78e (patch) | |
tree | a2fbabf7aff4bbcda37b2d3dad98aaf024e77f63 /test | |
parent | 87c0b99446b0aa2265e25d0cf06ba5676e1683a9 (diff) | |
download | ruby-30ab36c7dc743d584a1534c5695ba37fbfb1c78e.tar.gz |
* string.c (rb_str_dump): fix expected length. [ruby-core:32935]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_stringchar.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_stringchar.rb b/test/ruby/test_stringchar.rb index b70f171c84..44c8634c02 100644 --- a/test/ruby/test_stringchar.rb +++ b/test/ruby/test_stringchar.rb @@ -163,4 +163,19 @@ EOS s.delete!("a-z") assert_equal("BB", s) end + + def test_dump + bug3996 = '[ruby-core:32935]' + Encoding.list.find_all {|enc| enc.ascii_compatible?}.each do |enc| + (0..256).map do |c| + begin + s = c.chr(enc) + rescue RangeError, ArgumentError + break + else + assert_not_match(/\0/, s.dump, bug3996) + end + end + end + end end |