diff options
Diffstat (limited to 't/stress.t')
-rw-r--r-- | t/stress.t | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/t/stress.t b/t/stress.t new file mode 100644 index 0000000..1f9b351 --- /dev/null +++ b/t/stress.t @@ -0,0 +1,57 @@ +# $Id: stress.t,v 1.3 2000/04/17 17:08:58 matt Exp $ + +print "1..7\n"; +my $x; $x++; +use XML::XPath; +use XML::XPath::Parser; + +my $xp = XML::XPath->new( filename => 'examples/test.xml' ); + +print "ok $x\n" if $xp; +print "not ok $x\n" unless $xp; +$x++; + +my $pp = XML::XPath::Parser->new(); + +print "ok $x\n" if $pp; +print "not ok $x\n" unless $pp; +$x++; + +# test path parse time +for (1..5000) { + $pp->parse('//project/wednesday'); +} + +print "ok $x\n" if $pp; +print "not ok $x\n" unless $pp; +$x++; + +my $parser = XML::XPath::XMLParser->new( + filename => 'examples/test.xml' + ); + +print "ok $x\n" if $parser; +print "not ok $x\n" unless $parser; +$x++; + +my $root = $parser->parse; + +print "ok $x\n" if $root; +print "not ok $x\n" unless $root; +$x++; + +# test evaluation time +my $path = $pp->parse('/timesheet/projects/project/wednesday'); + +print "ok $x\n" if $path; +print "not ok $x\n" unless $path; +$x++; + +for (1..1000) { + $path->evaluate($root); +} + +print "ok $x\n"; +$x++; + + |