summaryrefslogtreecommitdiff
path: root/test/ruby/test_marshal.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_marshal.rb')
-rw-r--r--test/ruby/test_marshal.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index 28cf38c7dbd..31975b7aea7 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -1,4 +1,5 @@
require 'test/unit'
+require 'tempfile'
require_relative 'marshaltestlib'
class TestMarshal < Test::Unit::TestCase
@@ -325,6 +326,15 @@ class TestMarshal < Test::Unit::TestCase
b = "\x82\xa2".force_encoding(Encoding::Windows_31J)
c = [/#{a}/, /#{b}/]
assert_equal(c, Marshal.load(Marshal.dump(c)), bug2109)
+
+ assert_nothing_raised(ArgumentError, '[ruby-dev:40386]') do
+ re = Tempfile.open("marshal_regexp") do |f|
+ f.binmode.write("\x04\bI/\x00\x00\x06:\rencoding\"\rUS-ASCII")
+ f.close
+ Marshal.load(f.open.binmode)
+ end
+ assert_equal(//, re)
+ end
end
class DumpTest