# 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 ReversableTest
  def test_reverse
    DS_Test_Case.method_checked(:reverse, @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.reverse, l.reverse)
    end
  end

  def test_reverse_bang
    DS_Test_Case.method_checked(:reverse!, @test_container)
    for i in 0...N do
      a = generate_random_container(i, @analgous_container).dup()
      l = generate_container_from_analgous(a)
      a.reverse!
      l.reverse!
      assert_containers_equal(a.reverse, l.reverse)
    end
  end
end
