summaryrefslogtreecommitdiff
path: root/test/ruby/test_stringchar.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_stringchar.rb')
-rw-r--r--test/ruby/test_stringchar.rb15
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