home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_0a57eaf7f53918e6a9aac7656edd4d19
< prev
next >
Wrap
Text File
|
2000-03-23
|
6KB
|
146 lines
<HTML>
<HEAD>
<TITLE>Test - utilities to aid in testing WWW::Search backends</TITLE>
<LINK REL="stylesheet" HREF="../../../../Active.css" TYPE="text/css">
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Test - utilities to aid in testing WWW::Search backends</P></STRONG>
</TD></TR>
</TABLE>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
<LI><A HREF="#synopsys">SYNOPSYS</A></LI>
<LI><A HREF="#description">DESCRIPTION</A></LI>
<LI><A HREF="#methods and functions">METHODS AND FUNCTIONS</A></LI>
<UL>
<LI><A HREF="#new">new</A></LI>
<LI><A HREF="#mode">mode</A></LI>
<LI><A HREF="#relevant_test">relevant_test</A></LI>
<LI><A HREF="#eval_test">eval_test</A></LI>
<LI><A HREF="#test">test</A></LI>
<LI><A HREF="#no_test">no_test</A></LI>
<LI><A HREF="#not_working">not_working</A></LI>
<LI><A HREF="#not_working_with_tests">not_working_with_tests</A></LI>
<LI><A HREF="#not_working_and_abandoned">not_working_and_abandoned</A></LI>
<LI><A HREF="#wc_l (private, not a method)">wc_l (private, not a method)</A></LI>
<LI><A HREF="#diff (private, not a method)">diff (private, not a method)</A></LI>
</UL>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>Test - utilities to aid in testing WWW::Search backends</P>
<P>
<HR>
<H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
<UL>
<LI>Linux</LI>
<LI>Solaris</LI>
<LI>Windows</LI>
</UL>
<HR>
<H1><A NAME="synopsys">SYNOPSYS</A></H1>
<PRE>
$oTest = new WWW::Search::Test('HotBot,Yahoo,Excite');
$oTest->test('HotBot', 'Kingpin', 'one', $sQuery, $TEST_RANGE, 1, 10);</PRE>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>See file test.pl in the WWW-Search-HotBot distribution for a detailed
``real-world'' example.</P>
<P>
<HR>
<H1><A NAME="methods and functions">METHODS AND FUNCTIONS</A></H1>
<P>
<H2><A NAME="new">new</A></H2>
<P>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.</P>
<P>
<H2><A NAME="mode">mode</A></H2>
<P>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.</P>
<P>There are three test modes available. They are:</P>
<PRE>
$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.</PRE>
<P>
<H2><A NAME="relevant_test">relevant_test</A></H2>
<P>Given the name of a backend,
returns true if this Test object is able to test that backend.</P>
<P>
<H2><A NAME="eval_test">eval_test</A></H2>
<P>Given the name of a backend,
grabs the $TEST_CASES variable from that backend and evaluates it.</P>
<P>
<H2><A NAME="test">test</A></H2>
<P>Run <CODE>test(s)</CODE> 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).</P>
<P>Several test methods are possible:</P>
<PRE>
$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.</PRE>
<P>
<H2><A NAME="no_test">no_test</A></H2>
<P>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.</P>
<P>
<H2><A NAME="not_working">not_working</A></H2>
<P>Prints a message stating that this backend is known to be broken.
Takes two arguments, the backend name and the name of the maintainer.</P>
<P>
<H2><A NAME="not_working_with_tests">not_working_with_tests</A></H2>
<P>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.</P>
<P>
<H2><A NAME="not_working_and_abandoned">not_working_and_abandoned</A></H2>
<P>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.</P>
<P>
<H2><A NAME="wc_l (private, not a method)">wc_l (private, not a method)</A></H2>
<P>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)</P>
<P>
<H2><A NAME="diff (private, not a method)">diff (private, not a method)</A></H2>
<P>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)</P>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Test - utilities to aid in testing WWW::Search backends</P></STRONG>
</TD></TR>
</TABLE>
</BODY>
</HTML>