зеркало из https://github.com/github/ruby.git
add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
1d10aa8bfc
Коммит
785191b12d
|
@ -329,4 +329,26 @@ class TestMarshal < Test::Unit::TestCase
|
|||
assert_equal("foo", d.instance_variable_get(:@foo))
|
||||
assert_equal(false, d.instance_variable_defined?(:@x))
|
||||
end
|
||||
|
||||
class C6
|
||||
def initialize
|
||||
@stdin = STDIN
|
||||
end
|
||||
attr_reader :stdin
|
||||
def marshal_dump
|
||||
1
|
||||
end
|
||||
def marshal_load(x)
|
||||
@stdin = STDIN
|
||||
end
|
||||
end
|
||||
def test_marshal_dump_extra_iv
|
||||
o = C6.new
|
||||
m = nil
|
||||
assert_nothing_raised("[ruby-dev:21475] [ruby-dev:39845]") {
|
||||
m = Marshal.dump(o)
|
||||
}
|
||||
o2 = Marshal.load(m)
|
||||
assert_equal(STDIN, o.stdin)
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче