mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add a test for [ruby-dev:31709].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e8959acc9f
commit
96c859834e
1 changed files with 8 additions and 0 deletions
|
@ -36,4 +36,12 @@ class TestMarshal < Test::Unit::TestCase
|
|||
def test_marshal_cloned_class
|
||||
assert_instance_of(StrClone, Marshal.load(Marshal.dump(StrClone.new("abc"))))
|
||||
end
|
||||
|
||||
def test_inconsistent_struct
|
||||
TestMarshal.const_set :S, Struct.new(:a)
|
||||
s = Marshal.dump(S.new(1))
|
||||
TestMarshal.instance_eval { remove_const :S }
|
||||
TestMarshal.const_set :S, Class.new
|
||||
assert_raise(TypeError, "[ruby-dev:31709]") { Marshal.load(s) }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue