def check(n=RANTLY_COUNT,limit=10,&assertion)
i = 0
test_data = nil
begin
Rantly.singleton.generate(n,limit,@property) do |val|
test_data = val
assertion.call(val) if assertion
io.puts "" if i % 100 == 0
io.print "." if i % 10 == 0
i += 1
end
io.puts
io.puts "success: #{i} tests"
rescue Rantly::TooManyTries => e
io.puts
io.puts "too many tries: #{e.tries}"
raise e
rescue Exception => boom
io.puts
io.puts "failure: #{i} tests, on:"
pretty_print test_data
@failed_data = test_data
if @failed_data.respond_to?(:shrink)
@shrunk_failed_data, @depth = shrinkify(assertion, @failed_data)
io.puts "minimal failed data (depth #{@depth}) is:"
pretty_print @shrunk_failed_data
end
raise $!, "failure: #{i} tests, on:\n#{test_data}\n\n#{boom}\n", $@
end
end