ruby-changes:1847
From: ko1@a...
Date: 2 Sep 2007 15:40:07 +0900
Subject: [ruby-changes:1847] akr - Ruby:r13338 (trunk): add a test for .
akr 2007-09-02 15:39:58 +0900 (Sun, 02 Sep 2007)
New Revision: 13338
Modified files:
trunk/test/ruby/test_marshal.rb
Log:
add a test for [ruby-dev:31709].
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_marshal.rb?r1=13338&r2=13337
Index: test/ruby/test_marshal.rb
===================================================================
--- test/ruby/test_marshal.rb (revision 13337)
+++ test/ruby/test_marshal.rb (revision 13338)
@@ -36,4 +36,12 @@
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
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml