ActivePerl Documentation
|
NAMETest - utilities to aid in testing WWW::Search backends
SUPPORTED PLATFORMS
SYNOPSYS
$oTest = new WWW::Search::Test('HotBot,Yahoo,Excite');
$oTest->test('HotBot', 'Kingpin', 'one', $sQuery, $TEST_RANGE, 1, 10);
DESCRIPTIONSee file test.pl in the WWW-Search-HotBot distribution for a detailed ``real-world'' example.
METHODS AND FUNCTIONS
newCreate a new WWW::Search::Test object. All arguments are strings, names of backends that this object will be able to test. If no arguments are given, will be able to test all backends.
modeSet / get the test mode of this object. If an argument is given, sets the mode to that value. Returns the current (or newly set) value. There are three test modes available. They are: $MODE_INTERNAL: parse URLs out of saved pages (as a sanity check or regression test); $MODE_EXTERNAL: send the query to the search engine "live", parse the results, and compare them to the previously saved results; and $MODE_UPDATE: send the query to the search engine "live", parse the results, and save them for future testing.
relevant_testGiven the name of a backend, returns true if this Test object is able to test that backend.
eval_testGiven the name of a backend, grabs the $TEST_CASES variable from that backend and evaluates it.
testRun Several test methods are possible: $TEST_EXACTLY: list of URLs must match exactly (line for line, in order); $TEST_BY_COUNTING: test passes if number of resulting URLs is equal; $TEST_GREATER_THAN: test passes if we get more than N result URLs; and $TEST_RANGE: like $TEST_GREATER_THAN but constrained on both ends.
no_testPrints a message stating that this backend does not have a test suite. Takes two arguments, the backend name and the name of the maintainer.
not_workingPrints a message stating that this backend is known to be broken. Takes two arguments, the backend name and the name of the maintainer.
not_working_with_testsPrints a message stating that this backend is known to be broken even though it has a test suite. Takes two arguments, the backend name and the name of the maintainer.
not_working_and_abandonedPrints a message stating that this backend is known to be broken and is not being actively maintained. Takes two arguments, the backend name and the name of the maintainer.
wc_l (private, not a method)Given a filename, count the number of lines of text contained within the file. (I.e. simulate running UNIX command wc -l on a file)
diff (private, not a method)Given two files, returns TRUE if contents are line-by-line different, or FALSE if contents are line-by-line same. (I.e. like the UNIX command diff, but just reports true or false)
|