aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-02 06:39:58 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-02 06:39:58 +0000
commit96c859834e792cc0ad82868f602c363684857917 (patch)
treeab96031edbd93cb6ffb9953270f46be931da434b /test
parente8959acc9f469e0d5e1c1b146e078fe02c12cb7a (diff)
downloadruby-96c859834e792cc0ad82868f602c363684857917.tar.gz
add a test for [ruby-dev:31709].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_marshal.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index f594971e25..91a387dd45 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -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