summaryrefslogtreecommitdiff
path: root/t/02descendant.t
diff options
context:
space:
mode:
Diffstat (limited to 't/02descendant.t')
-rw-r--r--t/02descendant.t23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/02descendant.t b/t/02descendant.t
new file mode 100644
index 0000000..6c83e46
--- /dev/null
+++ b/t/02descendant.t
@@ -0,0 +1,23 @@
+use Test;
+BEGIN { plan tests => 4 }
+
+use XML::XPath;
+ok(1);
+
+my $xp = XML::XPath->new(ioref => *DATA);
+ok($xp);
+
+my @bbb = $xp->findnodes('//BBB');
+ok(@bbb, 5);
+
+my @subbbb = $xp->findnodes('//DDD/BBB');
+ok(@subbbb, 3);
+
+__DATA__
+<AAA>
+<BBB/>
+<CCC/>
+<BBB/>
+<DDD><BBB/></DDD>
+<CCC><DDD><BBB/><BBB/></DDD></CCC>
+</AAA>