summaryrefslogtreecommitdiff
path: root/t/stress.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2003-01-26 19:35:03 +0000
committer <>2015-02-23 10:18:26 +0000
commita2d12bc84fb2af87dd1c0c6e5bc854554902cd67 (patch)
tree7665979c7c281b21971de576d93246a022bff649 /t/stress.t
downloadperl-xml-xpath-a2d12bc84fb2af87dd1c0c6e5bc854554902cd67.tar.gz
Imported from /home/lorry/working-area/delta_perl-xml-xpath/XML-XPath-1.13.tar.gz.HEADXML-XPath-1.13master
Diffstat (limited to 't/stress.t')
-rw-r--r--t/stress.t57
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++;
+
+