[Http-webtest-commits] CVS: HTTP-WebTest/t 02-generic.t,1.5,1.6
Brought to you by:
m_ilya,
richardanderson
From: Ilya M. <m_...@us...> - 2002-02-15 14:48:49
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv24976/t Modified Files: 02-generic.t Log Message: Added tests for test param values caching Index: 02-generic.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/02-generic.t,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** 02-generic.t 15 Feb 2002 10:39:49 -0000 1.5 --- 02-generic.t 15 Feb 2002 14:48:42 -0000 1.6 *************** *** 18,22 **** use vars qw($HOSTNAME $PORT $URL); ! BEGIN { plan tests => 18 } # init tests --- 18,22 ---- use vars qw($HOSTNAME $PORT $URL); ! BEGIN { plan tests => 21 } # init tests *************** *** 388,391 **** --- 388,416 ---- tests => $tests, check_file => 't/test.out/redirect'); + } + + # 19-21: test subroutine caching + { + my $value = 0; + + my $sub = sub { + $value ++; + + return abs_url($URL, '/test-file1'); + }; + + my $tests1 = [ { url => $sub } ]; + my $opts = { default_report => 'no' }; + + $WEBTEST->run_tests($tests1, $opts); + ok($value == 1); + $WEBTEST->run_tests($tests1, $opts); + ok($value == 2); + + my $tests2 = [ { url => $sub }, + { url => $sub } ]; + + $WEBTEST->run_tests($tests1, $opts); + ok($value == 3); } |