diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-01-28 13:48:36 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-01-28 15:23:51 +0900 |
commit | ac2b945bc0182859ea538dc6b02ad6945a5cf212 (patch) | |
tree | 0be961782b3d2c224f55213da6d6e8d3189cb60b | |
parent | 251930cea0e935494b1e8cbbe851e63b978dbc80 (diff) | |
download | ruby-ac2b945bc0182859ea538dc6b02ad6945a5cf212.tar.gz |
support multi-run for test/ruby/test_marshal.rb
need to remove Constants.
-rw-r--r-- | test/ruby/test_marshal.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index dbeee825da..1d096adb18 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -596,7 +596,8 @@ class TestMarshal < Test::Unit::TestCase end def test_unloadable_data - c = eval("class Unloadable\u{23F0 23F3}<Time;;self;end") + name = "Unloadable\u{23F0 23F3}" + c = eval("class #{name} < Time;;self;end") c.class_eval { alias _dump_data _dump undef _dump @@ -605,10 +606,16 @@ class TestMarshal < Test::Unit::TestCase assert_raise_with_message(TypeError, /Unloadable\u{23F0 23F3}/) { Marshal.load(d) } + + # cleanup + self.class.class_eval do + remove_const name + end end def test_unloadable_userdef - c = eval("class Userdef\u{23F0 23F3}<Time;self;end") + name = "Userdef\u{23F0 23F3}" + c = eval("class #{name} < Time;self;end") class << c undef _load end @@ -616,6 +623,11 @@ class TestMarshal < Test::Unit::TestCase assert_raise_with_message(TypeError, /Userdef\u{23F0 23F3}/) { Marshal.load(d) } + + # cleanup + self.class.class_eval do + remove_const name + end end def test_unloadable_usrmarshal |