#!/usr/bin/env ruby
# $Id: TestHollow.rb,v 1.4 2001/05/27 07:06:24 matju Exp $
=begin

	MetaRuby
	file: Unit-tests for HollowArray, HollowHash, HollowString.
	(requires CVS version of rubicon)

	Copyright (c) 2001 by Mathieu Bouchard
	Licensed under the same license as Ruby.

=end

load "tests/test.conf"
require "rubicon"

require "builtin/ArrayBase"
require "builtin/HashBase"
require "builtin/StringBase"

require "Hollow/Array"
require "Hollow/Hash"
require "Hollow/String"

class TestHollowArray < ArrayBase
  def initialize(*args); @cls = AutoArray; super; end
end

class TestHollowHash < HashBase
  def initialize(*args); @cls = AutoHash; super; end
end

class TestHollowString < StringBase
  def initialize(*args); @cls = AutoString; super; end
end

if $0 == __FILE__ then
	foo = [
		TestHollowArray,
		TestHollowHash,
		TestHollowString,
	].map {|part|
		result = Rubicon::handleTests part
		"%20s %10d %10d %10d\n" % [part, -1,
			result.failures.length,
			result.errors.length]
	}
	3.times {puts}
	print("%20s %10s %10s %10s\n" % ["part", "success", "failure", "error"])
	print foo
end
