WWW::Search::Test 2.489
Sponsored Links
WWW::Search::Test 2.489 Ranking & Summary
File size:
0.083 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
1040
Date added:
2006-12-18
Publisher:
University of Southern California
WWW::Search::Test 2.489 description
WWW::Search::Test contains utilities to aid in testing WWW::Search backends.
SYNOPSIS
$oTest = new WWW::Search::Test(HotBot,Yahoo,Excite);
$oTest->test(HotBot, Kingpin, one, $sQuery, $TEST_RANGE, 1, 10);
See file test.pl in the WWW-Search-HotBot distribution for a detailed "real-world" example.
METHODS AND FUNCTIONS
new
Create 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.
mode
Set / 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_test
Given the name of a backend, returns true if this Test object is able to test that backend.
eval_test
Given the name of a backend, grabs the $TEST_CASES variable from that backend and evaluates it.
test
Run test(s) for a backend. Arguments are, in order: name of a backend to test (string, required); name of backend maintainer (string, if undef $backend::MAINTAINER will be used); filename for results storage/comparison (string, required); query to be sent to backend (string, required); test method (required, one of the following).
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_test
Prints 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_working
Prints 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_tests
Prints 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_abandoned
Prints 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.
reset_error_count
Reset the counter of errors to zero. You probably want to call this before each call to test() or eval_test().
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)
Shortcuts for running backend tests
WWW::Search::Test keeps its own count of test numbers, so if you want to mix-and-match these functions with your own tests, use the $WWW::Search::Test::iTest counter.
new_engine
One argument: the name of a backend suitable to be passed to WWW::Search::new(). Prints ok or not ok and the test number. Creates a WWW::Search object internally, to be used for all subsequent calls to run_test and run_gui_test (see below).
tm_new_engine
Same as new_engine(), but uses Test::More instead of just printing ok.
run_test
Three arguments: a query string, NOT escaped; a minimum number of expected results; and a maximum number of expected results. Optional fourth argument: integer value to be used as the search_debug.
If the minimum is undef, assumes zero. If the maximum is undef, does not check.
Prints ok or not ok and the test number.
run_gui_test
Same as run_test(), but calls gui_query() instead of native_query().
tm_run_test
Same as run_test(), but uses Test::More rather than just printing ok.
Note: If you use this function inside a TODO block, you must set global variable $TODO rather than a local $TODO, and you must set the global $TODO back to empty-string (or undef) at the end of your TODO block. For example:
TODO:
{
$TODO = I have not fixed this yet;
ok(...);
$TODO = ;
} # end of TODO block
tm_run_test_no_approx
Same as tm_run_test, but does NOT check the approximate_result_count.
count_results
Run a query, and return the actual (not approximate) number of hits.
skip_test
You can call this function instead of run_test() or run_gui_test() if the current test must be skipped for any reason.
SYNOPSIS
$oTest = new WWW::Search::Test(HotBot,Yahoo,Excite);
$oTest->test(HotBot, Kingpin, one, $sQuery, $TEST_RANGE, 1, 10);
See file test.pl in the WWW-Search-HotBot distribution for a detailed "real-world" example.
METHODS AND FUNCTIONS
new
Create 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.
mode
Set / 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_test
Given the name of a backend, returns true if this Test object is able to test that backend.
eval_test
Given the name of a backend, grabs the $TEST_CASES variable from that backend and evaluates it.
test
Run test(s) for a backend. Arguments are, in order: name of a backend to test (string, required); name of backend maintainer (string, if undef $backend::MAINTAINER will be used); filename for results storage/comparison (string, required); query to be sent to backend (string, required); test method (required, one of the following).
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_test
Prints 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_working
Prints 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_tests
Prints 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_abandoned
Prints 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.
reset_error_count
Reset the counter of errors to zero. You probably want to call this before each call to test() or eval_test().
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)
Shortcuts for running backend tests
WWW::Search::Test keeps its own count of test numbers, so if you want to mix-and-match these functions with your own tests, use the $WWW::Search::Test::iTest counter.
new_engine
One argument: the name of a backend suitable to be passed to WWW::Search::new(). Prints ok or not ok and the test number. Creates a WWW::Search object internally, to be used for all subsequent calls to run_test and run_gui_test (see below).
tm_new_engine
Same as new_engine(), but uses Test::More instead of just printing ok.
run_test
Three arguments: a query string, NOT escaped; a minimum number of expected results; and a maximum number of expected results. Optional fourth argument: integer value to be used as the search_debug.
If the minimum is undef, assumes zero. If the maximum is undef, does not check.
Prints ok or not ok and the test number.
run_gui_test
Same as run_test(), but calls gui_query() instead of native_query().
tm_run_test
Same as run_test(), but uses Test::More rather than just printing ok.
Note: If you use this function inside a TODO block, you must set global variable $TODO rather than a local $TODO, and you must set the global $TODO back to empty-string (or undef) at the end of your TODO block. For example:
TODO:
{
$TODO = I have not fixed this yet;
ok(...);
$TODO = ;
} # end of TODO block
tm_run_test_no_approx
Same as tm_run_test, but does NOT check the approximate_result_count.
count_results
Run a query, and return the actual (not approximate) number of hits.
skip_test
You can call this function instead of run_test() or run_gui_test() if the current test must be skipped for any reason.
WWW::Search::Test 2.489 Screenshot
WWW::Search::Test 2.489 Keywords
WWW
TEST
Test 2.489
URLs
HotBot
MODE
known to be
to test
to aid
takes two
aid in
backend
name
ToDo
query
results
Bookmark WWW::Search::Test 2.489
WWW::Search::Test 2.489 Copyright
WareSeeker periodically updates pricing and software information of WWW::Search::Test 2.489 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of WWW::Search::Test 2.489 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
backend productions
name definitions
todorelatos
backend of forever lyrics
backend process
numbersusa
results pk
query builder
camila todo cambio lyrics
baby names
debt settlement processing backend
backend boyz
it takes two
phone numbers
lottery results
bachendorfu0027s
query string
todos los periodicos
Related Software
WWW::Search is a collection of Perl modules which provide an API to WWW search engines. Free Download
WWW::Search::ZDnet is a Perl class for searching ALL of ZDnet. Free Download
WWW::Search::Yahoo is a Perl backend for searching www.yahoo.com Free Download
WWW::Search::Yahoo::TV::Echostar is a backend for searching tv.yahoo.com Free Download
WWW::Search::Yahoo::DE is Perl class for searching Yahoo! Deutschland. Free Download
WWW::Search::GoTo is Perl class for searching GoTo.com. Free Download
WWW::Search::YahooNews is a Perl backend for searching Yahoo News. Free Download
Search::FreeText is a free text indexing module for medium-to-large text corpuses. Free Download
Latest Software
Popular Software
Favourite Software