summaryrefslogtreecommitdiff
path: root/test/ruby/test_marshal.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-11 05:37:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-11 05:37:43 +0000
commit50bf2e550a6fb7cfa197d8429cf4a1e4f5e3e9c7 (patch)
tree0c316c6942ccb100ca7f860b7a9e7452cd705bfb /test/ruby/test_marshal.rb
parentd61a305270246ddc050e7b165b8242629957a25f (diff)
* marshal.c (r_object0): read sequentially since marshal source
may not be possible to rewind. [ruby-dev:40386] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 28cf38c7db..31975b7aea 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