mirror of
https://github.com/ruby/ruby.git
synced 2026-01-29 05:24:23 +00:00
support multi-run for test/ruby/test_marshal.rb
need to remove Constants.
This commit is contained in:
parent
251930cea0
commit
ac2b945bc0
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user