diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-16 14:25:19 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-16 14:25:19 +0000 |
commit | 53e4fb8c8027bd28f4aa8cda605b403b1a8a9aa4 (patch) | |
tree | 9a0b18490c47eeb1872eef9e4cf6236ee1a0d17c /test | |
parent | bdf16df33ae3eb9e6c513c29bcbb250dc8c9542b (diff) | |
download | ruby-53e4fb8c8027bd28f4aa8cda605b403b1a8a9aa4.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 no _load_data method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_marshal.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 115c6bcc5b..2a72703adc 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -661,4 +661,16 @@ class TestMarshal < Test::Unit::TestCase Marshal.dump(c.new) } end + + def test_unloadable_data + c = eval("class Unloadable\u{23F0 23F3}<Time;;self;end") + c.class_eval { + alias _dump_data _dump + undef _dump + } + d = Marshal.dump(c.new) + assert_raise_with_message(TypeError, /Unloadable\u{23F0 23F3}/) { + Marshal.load(d) + } + end end |