# 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).
# 
require 'ds_test_helpers.rb'
require 'heap'
requirelocal 'mixins/enumerable_test'
requirelocal 'mixins/comparable_test'
requirelocal 'mixins/pair_enumerable_test'
requirelocal 'mixins/hash_like_test'
requirelocal 'mixins/indexable_test'
requirelocal 'mixins/orderable_test'
requirelocal 'mixins/container_test'

N = 25

# Warning: instance method Heap#each was not checked
# Warning: instance method Heap#store was not checked
# Warning: instance method Heap#first was not checked
# Warning: instance method Heap#empty? was not checked
# Warning: instance method Heap#size was not checked
# Warning: instance method Heap#shift was not checked
# Warning: instance method Heap#[]= was not checked
# Warning: instance method Heap#clear was not checked
# Warning: instance method Heap#each_pair was not checked
# Warning: instance method Heap#nitems was not checked

class HeapTest < DS_Test_Case

  include EnumerableTest
  include ComparableTest
  include PairEnumerableTest
  include HashLikeTest
  include IndexableTest
  include OrderableTest
  include ContainerTest
 
  def initialize(*args)
    super(*args)
    @test_container = Heap
    @analgous_container = SortedHash
  end

  def generate_container_from_analgous(a)
    l = Heap.new
    a.each_pair do |*args|
      l.store(*args)
    end
    l
  end

end

exit run_test(HeapTest, Heap)

