ruby-changes:27579
From: marcandre <ko1@a...>
Date: Fri, 8 Mar 2013 10:21:52 +0900 (JST)
Subject: [ruby-changes:27579] marcandRe: r39631 (trunk): Remove very obsolete test code
marcandre 2013-03-08 10:21:41 +0900 (Fri, 08 Mar 2013) New Revision: 39631 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39631 Log: Remove very obsolete test code Modified files: trunk/test/drb/drbtest.rb trunk/test/ruby/marshaltestlib.rb Index: test/ruby/marshaltestlib.rb =================================================================== --- test/ruby/marshaltestlib.rb (revision 39630) +++ test/ruby/marshaltestlib.rb (revision 39631) @@ -244,31 +244,12 @@ module MarshalTestLib https://github.com/ruby/ruby/blob/trunk/test/ruby/marshaltestlib.rb#L244 end 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 def test_struct marshal_equal(MyStruct.new(1,2)) end 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)) end @@ -433,20 +414,6 @@ module MarshalTestLib https://github.com/ruby/ruby/blob/trunk/test/ruby/marshaltestlib.rb#L414 end 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 o = MyStruct2.new(1,2) marshal_equal(o) Index: test/drb/drbtest.rb =================================================================== --- test/drb/drbtest.rb (revision 39630) +++ test/drb/drbtest.rb (revision 39631) @@ -131,11 +131,7 @@ module DRbCore https://github.com/ruby/ruby/blob/trunk/test/drb/drbtest.rb#L131 obj = @there.unknown_module assert_kind_of(DRb::DRbUnknown, obj) - if RUBY_VERSION >= '1.8' - assert_equal('DRbEx::', obj.name) - else - assert_equal('DRbEx', obj.name) - end + assert_equal('DRbEx::', obj.name) assert_raise(DRb::DRbUnknownError) do @there.unknown_error -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/