1# $Id: stress.t,v 1.3 2000/04/17 17:08:58 matt Exp $ 2 3print "1..7\n"; 4my $x; $x++; 5use XML::XPath; 6use XML::XPath::Parser; 7 8my $xp = XML::XPath->new( filename => 'examples/test.xml' ); 9 10print "ok $x\n" if $xp; 11print "not ok $x\n" unless $xp; 12$x++; 13 14my $pp = XML::XPath::Parser->new(); 15 16print "ok $x\n" if $pp; 17print "not ok $x\n" unless $pp; 18$x++; 19 20# test path parse time 21for (1..5000) { 22 $pp->parse('//project/wednesday'); 23} 24 25print "ok $x\n" if $pp; 26print "not ok $x\n" unless $pp; 27$x++; 28 29my $parser = XML::XPath::XMLParser->new( 30 filename => 'examples/test.xml' 31 ); 32 33print "ok $x\n" if $parser; 34print "not ok $x\n" unless $parser; 35$x++; 36 37my $root = $parser->parse; 38 39print "ok $x\n" if $root; 40print "not ok $x\n" unless $root; 41$x++; 42 43# test evaluation time 44my $path = $pp->parse('/timesheet/projects/project/wednesday'); 45 46print "ok $x\n" if $path; 47print "not ok $x\n" unless $path; 48$x++; 49 50for (1..1000) { 51 $path->evaluate($root); 52} 53 54print "ok $x\n"; 55$x++; 56 57 58