diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-16 14:25:33 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-16 14:25:33 +0000 |
commit | 0ea135d177cfda4ea565d8f3934379ccf405826d (patch) | |
tree | e78a8a5a5ec48d70f64f1b7d38b791262c7ed88e /test/ruby | |
parent | 53e4fb8c8027bd28f4aa8cda605b403b1a8a9aa4 (diff) | |
download | ruby-0ea135d177cfda4ea565d8f3934379ccf405826d.tar.gz |
marshal.c: class name encoding
* marshal.c (r_object0): preserve the encoding of the class name
in an error message, in the case of USERDEF without _load
singleton method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_marshal.rb | 11 |
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 |