[Http-webtest-commits] CVS: HTTP-WebTest/lib/HTTP WebTest.pm.in,1.4,1.5
Brought to you by:
m_ilya,
richardanderson
From: Ilya M. <m_...@us...> - 2002-02-17 10:49:01
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv8557/lib/HTTP Modified Files: WebTest.pm.in Log Message: Document embeded Perl syntax Index: WebTest.pm.in =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest.pm.in,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WebTest.pm.in 16 Feb 2002 00:00:46 -0000 1.4 --- WebTest.pm.in 17 Feb 2002 10:48:51 -0000 1.5 *************** *** 5,9 **** package HTTP::WebTest; ! $VERSION = '1.99_03'; # actual content of HTTP::WebTest package is in HTTP::WebTest::API --- 5,9 ---- package HTTP::WebTest; ! $VERSION = '1.99_04'; # actual content of HTTP::WebTest package is in HTTP::WebTest::API *************** *** 256,259 **** --- 256,286 ---- Perl metasymbols are interpreted: "\n\t" is a newline and a tab. + Also it is possible to specify Perl code instead of scalar, instead of + list parameter value or instead of element of list paramater. Curly + brackets are used to denote Perl code inside wtscript files. This + code will be evaluated during test run. + + C<HTTP::WebTest> compiles this Perl code as anonymous subroutines + which are called during test run when value of corresponding test + parameters are required. When these subroutines are called + C<HTTP::WebTest> object is passed to them. + + Some examples of syntax: + + # scalar value + name = { 1 + 1 } + + # list value (Perl code should return array reference) + name = { [ a => 'b', c => 'd' ] } + + # element of list value + name = ( + 'first value' + { "first " . "value" } + ) + + # accessing HTTP::WebTest object + name = { my $webtest = shift; ..... } + =head3 Examples of wtscript files *************** *** 327,330 **** --- 354,362 ---- test parameters. Additionally, optional global test parameters can be passed in a hash passed as the second argument. + + Instead of test parameter values subroutine references can be + specified. Referenced subroutines are called during test run when + values of corresponding test parameters are required. When called + these subroutines get C<HTTP::WebTest> object passed to them. Tests can be run as |