aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_marshal.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index 1b74b47dd1..3548850a42 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -684,4 +684,15 @@ class TestMarshal < Test::Unit::TestCase
Marshal.load(d)
}
end
+
+ def test_unloadable_usrmarshal
+ c = eval("class UsrMarshal\u{23F0 23F3}<Time;self;end")
+ c.class_eval {
+ alias marshal_dump _dump
+ }
+ d = Marshal.dump(c.new)
+ assert_raise_with_message(TypeError, /UsrMarshal\u{23F0 23F3}/) {
+ Marshal.load(d)
+ }
+ end
end