diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-16 12:46:07 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-16 12:46:07 +0000 |
commit | bdf16df33ae3eb9e6c513c29bcbb250dc8c9542b (patch) | |
tree | fca185e0af9d68afaed90a6633083f40813613b2 /test/ruby/test_marshal.rb | |
parent | 2c1c5570e83ab6cc7f832cf0249e0c44cb2689e0 (diff) | |
download | ruby-bdf16df33ae3eb9e6c513c29bcbb250dc8c9542b.tar.gz |
marshal.c: class name encoding
* marshal.c (w_object): preserve the encoding of the class name in
an error message, in the case of no _dump_data method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_marshal.rb')
-rw-r--r-- | test/ruby/test_marshal.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index c8d79edb02..115c6bcc5b 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -654,4 +654,11 @@ class TestMarshal < Test::Unit::TestCase Marshal.dump(c.new(0, autoclose: false)) } end + + def test_undumpable_data + c = Module.new {break module_eval("class T\u{23F0 23F3}<Time;undef _dump;self;end")} + assert_raise_with_message(TypeError, /T\u{23F0 23F3}/) { + Marshal.dump(c.new) + } + end end |