summaryrefslogtreecommitdiff
path: root/test/ruby/test_marshal.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_marshal.rb')
-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 2a72703adc..1b74b47dd1 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -673,4 +673,15 @@ class TestMarshal < Test::Unit::TestCase
Marshal.load(d)
}
end
+
+ def test_unloadable_userdef
+ c = eval("class Userdef\u{23F0 23F3}<Time;self;end")
+ class << c
+ undef _load
+ end
+ d = Marshal.dump(c.new)
+ assert_raise_with_message(TypeError, /Userdef\u{23F0 23F3}/) {
+ Marshal.load(d)
+ }
+ end
end