mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Remove very obsolete test code
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7afb2eaddd
commit
0003ac99cc
2 changed files with 1 additions and 38 deletions
|
@ -131,11 +131,7 @@ module DRbCore
|
||||||
|
|
||||||
obj = @there.unknown_module
|
obj = @there.unknown_module
|
||||||
assert_kind_of(DRb::DRbUnknown, obj)
|
assert_kind_of(DRb::DRbUnknown, obj)
|
||||||
if RUBY_VERSION >= '1.8'
|
assert_equal('DRbEx::', obj.name)
|
||||||
assert_equal('DRbEx::', obj.name)
|
|
||||||
else
|
|
||||||
assert_equal('DRbEx', obj.name)
|
|
||||||
end
|
|
||||||
|
|
||||||
assert_raise(DRb::DRbUnknownError) do
|
assert_raise(DRb::DRbUnknownError) do
|
||||||
@there.unknown_error
|
@there.unknown_error
|
||||||
|
|
|
@ -244,31 +244,12 @@ module MarshalTestLib
|
||||||
end
|
end
|
||||||
|
|
||||||
MyStruct = Struct.new("MyStruct", :a, :b)
|
MyStruct = Struct.new("MyStruct", :a, :b)
|
||||||
if RUBY_VERSION < "1.8.0"
|
|
||||||
# Struct#== is not defined in ruby/1.6
|
|
||||||
class MyStruct
|
|
||||||
def ==(rhs)
|
|
||||||
return true if __id__ == rhs.__id__
|
|
||||||
return false unless rhs.is_a?(::Struct)
|
|
||||||
return false if self.class != rhs.class
|
|
||||||
members.each do |member|
|
|
||||||
return false if self.__send__(member) != rhs.__send__(member)
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
class MySubStruct < MyStruct; def initialize(v, *args) super(*args); @v = v; end end
|
class MySubStruct < MyStruct; def initialize(v, *args) super(*args); @v = v; end end
|
||||||
def test_struct
|
def test_struct
|
||||||
marshal_equal(MyStruct.new(1,2))
|
marshal_equal(MyStruct.new(1,2))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_struct_subclass
|
def test_struct_subclass
|
||||||
if RUBY_VERSION < "1.8.0"
|
|
||||||
# Substruct instance cannot be dumped in ruby/1.6
|
|
||||||
# ::Marshal.dump(MySubStruct.new(10, 1, 2)) #=> uninitialized struct
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
marshal_equal(MySubStruct.new(10,1,2))
|
marshal_equal(MySubStruct.new(10,1,2))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -433,20 +414,6 @@ module MarshalTestLib
|
||||||
end
|
end
|
||||||
|
|
||||||
MyStruct2 = Struct.new(:a, :b)
|
MyStruct2 = Struct.new(:a, :b)
|
||||||
if RUBY_VERSION < "1.8.0"
|
|
||||||
# Struct#== is not defined in ruby/1.6
|
|
||||||
class MyStruct2
|
|
||||||
def ==(rhs)
|
|
||||||
return true if __id__ == rhs.__id__
|
|
||||||
return false unless rhs.is_a?(::Struct)
|
|
||||||
return false if self.class != rhs.class
|
|
||||||
members.each do |member|
|
|
||||||
return false if self.__send__(member) != rhs.__send__(member)
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
def test_struct_toplevel
|
def test_struct_toplevel
|
||||||
o = MyStruct2.new(1,2)
|
o = MyStruct2.new(1,2)
|
||||||
marshal_equal(o)
|
marshal_equal(o)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue