Test file for binary search functions

Each test looks something like this:
Problem 1
in [
]? no
Of lines 1 through 5+n of a given test,
Each line is in Unix style, ended with newline ( '\x0A' ).
Line 1 is the name of the problem.
Line 2 is a signed integer, T
Line 3 is the string "in ["
Line 4+i, where 0 <= i < n, is A[ i ], an int.
Line 4+n is either "]? yes" or "]? no" Line 5+n is a blank line.

There are 4096 tests, with arrays ranging up to about 512 elements, although the average is about 16 elements. The correct answer is "yes" in about half of the examples. Unzipped, tests.txt is 680k.

follow_tests.py (4K) Python code to run tests on a binary search function.
tests.txt.gz (86K) the test data, gzipped
tests.zip (86K) the test data, zipped
write_tests.py (2K) the test file generator

This page was made with a php script. Last change April 20, 2010.
--Steve Witham Up to my home page.