Update of /cvsroot/http-webtest/HTTP-WebTest/t
In directory usw-pr-cvs1:/tmp/cvs-serv19904/t
Modified Files:
simple.wt 06-parser.t
Added Files:
borked8.wt borked7.wt borked6.wt borked5.wt borked4.wt
Log Message:
Improve syntax error reporting in parser of wtscript files
Support for embeded Perl in wtscript files in parser
--- NEW FILE: borked8.wt ---
# $Id: borked8.wt,v 1.1 2002/01/29 03:52:40 m_ilya Exp $
param = ( unfinished
--- NEW FILE: borked7.wt ---
# $Id: borked7.wt,v 1.1 2002/01/29 03:52:40 m_ilya Exp $
param = { use strict; This is bad Perl code }
--- NEW FILE: borked6.wt ---
# $Id: borked6.wt,v 1.1 2002/01/29 03:52:40 m_ilya Exp $
param = { unfinished
--- NEW FILE: borked5.wt ---
# $Id: borked5.wt,v 1.1 2002/01/29 03:52:40 m_ilya Exp $
param = 'unfinished
--- NEW FILE: borked4.wt ---
# $Id: borked4.wt,v 1.1 2002/01/29 03:52:40 m_ilya Exp $
param = "unfinished
Index: simple.wt
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/simple.wt,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** simple.wt 2002/01/24 12:26:09 1.1.1.1
--- simple.wt 2002/01/29 03:52:40 1.2
***************
*** 53,54 ****
--- 53,62 ----
What a tasty cookie! )
end_test
+
+ test_name = { 'Some evals are here' }
+ file = { 1 + 2 + 3 . '.ext' }
+ params = ( { 'name' } => value
+ name1
+ { my $a = 'blabla'; $a =~ s/bla//; $a } )
+ auth = { [ http => 'http://some.proxy.com/' ] }
+ end_test
Index: 06-parser.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/06-parser.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** 06-parser.t 2002/01/28 09:49:55 1.2
--- 06-parser.t 2002/01/29 03:52:40 1.3
***************
*** 13,19 ****
require 't/utils.pl';
! BEGIN { plan tests => 27 }
! # 1-24: check parsing wt script (contain all syntax variants)
{
my $filename = shift;
--- 13,19 ----
require 't/utils.pl';
! BEGIN { plan tests => 39 }
! # 1-31: check parsing wt script (contain all syntax variants)
{
my $filename = shift;
***************
*** 23,26 ****
--- 23,27 ----
# check $tests
+ ok(@$tests == 3);
ok($tests->[0]{test_name} eq 'Some name here');
ok($tests->[0]{auth}[0] eq 'name');
***************
*** 41,44 ****
--- 42,57 ----
ok($tests->[1]{cookie}[0][2] eq 'This is the cookie value');
ok($tests->[1]{cookie}[1][1] eq 'webtest1');
+ my $sub = $tests->[2]{test_name};
+ ok($sub->() eq 'Some evals are here');
+ $sub = $tests->[2]{file};
+ ok($sub->() eq '6.ext');
+ $sub = $tests->[2]{params}[0];
+ ok($sub->() eq 'name');
+ $sub = $tests->[2]{params}[3];
+ ok($sub->() eq 'bla');
+ $sub = $tests->[2]{auth};
+ my $aref = $sub->();
+ ok($aref->[0] eq 'http');
+ ok($aref->[1] eq 'http://some.proxy.com/');
# check $opts
***************
*** 51,58 ****
}
! # 25-27: check error handling for borked wtscript files
parse_error_check('t/borked1.wt', 't/test.out/borked1.err');
parse_error_check('t/borked2.wt', 't/test.out/borked2.err');
parse_error_check('t/borked3.wt', 't/test.out/borked3.err');
sub parse_error_check {
--- 64,76 ----
}
! # 32-39: check error handling for borked wtscript files
parse_error_check('t/borked1.wt', 't/test.out/borked1.err');
parse_error_check('t/borked2.wt', 't/test.out/borked2.err');
parse_error_check('t/borked3.wt', 't/test.out/borked3.err');
+ parse_error_check('t/borked4.wt', 't/test.out/borked4.err');
+ parse_error_check('t/borked5.wt', 't/test.out/borked5.err');
+ parse_error_check('t/borked6.wt', 't/test.out/borked6.err');
+ parse_error_check('t/borked7.wt', 't/test.out/borked7.err');
+ parse_error_check('t/borked8.wt', 't/test.out/borked8.err');
sub parse_error_check {
|