# Ruby Treasures 0.1
# Copyright (C) 2001 Paul Brannan <paul@atdesk.com>
# 
# You may distribute this software under the same terms as Ruby (see the file
# COPYING that was distributed with this library).
# 
module ReverseEnumerableTest
  def test_reverse_each
    DS_Test_Case.method_checked(:reverse_each, @test_container)
    for i in 0...N do
      a = generate_random_container(i, @analgous_container)
      l = generate_container_from_analgous(a)
      assert_containers_equal(a, l, :reverse_each)
    end
  end

  def test_reverse_each_pair
    if @test_container.method_defined?(:reverse_each_pair) then
      DS_Test_Case.method_checked(:reverse_each_pair, @test_container)
      for i in 0...N do
        a = generate_random_container(i, @analgous_container)
        l = generate_container_from_analgous(a)
        assert_containers_equal(a, l, :reverse_each_pair)
      end
    end
  end
end
