summaryrefslogtreecommitdiff
path: root/t/10pipe.t
diff options
context:
space:
mode:
Diffstat (limited to 't/10pipe.t')
-rw-r--r--t/10pipe.t27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/10pipe.t b/t/10pipe.t
new file mode 100644
index 0000000..85a2677
--- /dev/null
+++ b/t/10pipe.t
@@ -0,0 +1,27 @@
+use Test;
+BEGIN { plan tests => 6, todo => [] }
+
+use XML::XPath;
+ok(1);
+
+my $xp = XML::XPath->new(ioref => *DATA);
+ok($xp);
+
+my @nodes;
+@nodes = $xp->findnodes('//CCC | //BBB');
+ok(@nodes, 3);
+ok($nodes[0]->getName, "BBB"); # test document order
+
+@nodes = $xp->findnodes('/AAA/EEE | //BBB');
+ok(@nodes, 2);
+
+@nodes = $xp->findnodes('/AAA/EEE | //DDD/CCC | /AAA | //BBB');
+ok(@nodes, 4);
+
+__DATA__
+<AAA>
+<BBB/>
+<CCC/>
+<DDD><CCC/></DDD>
+<EEE/>
+</AAA>