diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-07 16:53:34 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-07 16:53:34 +0000 |
commit | 785191b12d23830480a75635275dadf30f4724d9 (patch) | |
tree | ba43b4b9724295f6efcf8a56e442fc80ee6fd7d2 /test | |
parent | 1d10aa8bfc98a42522716f71aae60cb70498a6e6 (diff) | |
download | ruby-785191b12d23830480a75635275dadf30f4724d9.tar.gz |
add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_marshal.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 69c11d6688..12d1bff30c 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -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 |