зеркало из https://github.com/github/ruby.git
Tempfile is not needed
This commit is contained in:
Родитель
f0923164d8
Коммит
812272bdb2
|
@ -1,6 +1,5 @@
|
||||||
# frozen_string_literal: false
|
# frozen_string_literal: false
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
require 'tempfile'
|
|
||||||
require_relative 'marshaltestlib'
|
require_relative 'marshaltestlib'
|
||||||
|
|
||||||
class TestMarshal < Test::Unit::TestCase
|
class TestMarshal < Test::Unit::TestCase
|
||||||
|
@ -314,11 +313,10 @@ class TestMarshal < Test::Unit::TestCase
|
||||||
assert_equal(c, Marshal.load(Marshal.dump(c)), bug2109)
|
assert_equal(c, Marshal.load(Marshal.dump(c)), bug2109)
|
||||||
|
|
||||||
assert_nothing_raised(ArgumentError, '[ruby-dev:40386]') do
|
assert_nothing_raised(ArgumentError, '[ruby-dev:40386]') do
|
||||||
re = Tempfile.create("marshal_regexp") do |f|
|
re = IO.pipe do |r, w|
|
||||||
f.binmode.write("\x04\bI/\x00\x00\x06:\rencoding\"\rUS-ASCII")
|
w.write("\x04\bI/\x00\x00\x06:\rencoding\"\rUS-ASCII")
|
||||||
f.rewind
|
# Marshal.load would not overread and block
|
||||||
re2 = Marshal.load(f)
|
Marshal.load(r)
|
||||||
re2
|
|
||||||
end
|
end
|
||||||
assert_equal(//, re)
|
assert_equal(//, re)
|
||||||
end
|
end
|
||||||
|
|
Загрузка…
Ссылка в новой задаче