summaryrefslogtreecommitdiff
path: root/t/29desc_with_predicate.t
diff options
context:
space:
mode:
Diffstat (limited to 't/29desc_with_predicate.t')
-rw-r--r--t/29desc_with_predicate.t21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/29desc_with_predicate.t b/t/29desc_with_predicate.t
new file mode 100644
index 0000000..b6675ba
--- /dev/null
+++ b/t/29desc_with_predicate.t
@@ -0,0 +1,21 @@
+use Test;
+BEGIN { plan tests => 4 }
+
+use XML::XPath;
+ok(1);
+
+my $xp = XML::XPath->new(ioref => *DATA);
+ok($xp);
+
+my @bbb = $xp->findnodes('/descendant::BBB[1]');
+ok(@bbb, 1);
+ok($bbb[0]->string_value, "OK");
+
+__DATA__
+<AAA>
+<BBB>OK</BBB>
+<CCC/>
+<BBB/>
+<DDD><BBB/></DDD>
+<CCC><DDD><BBB/><BBB>NOT OK</BBB></DDD></CCC>
+</AAA>