diff options
Diffstat (limited to 't/09string_length.t')
-rw-r--r-- | t/09string_length.t | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/09string_length.t b/t/09string_length.t new file mode 100644 index 0000000..b08bee4 --- /dev/null +++ b/t/09string_length.t @@ -0,0 +1,28 @@ +use Test; +BEGIN { plan tests => 5 } + +use XML::XPath; +ok(1); + +my $xp = XML::XPath->new(ioref => *DATA); +ok($xp); + +my @nodes; +@nodes = $xp->findnodes('//*[string-length(name()) = 3]'); +ok(@nodes, 2); + +@nodes = $xp->findnodes('//*[string-length(name()) < 3]'); +ok(@nodes, 2); + +@nodes = $xp->findnodes('//*[string-length(name()) > 3]'); +ok(@nodes, 3); + +__DATA__ +<AAA> +<Q/> +<SSSS/> +<BB/> +<CCC/> +<DDDDDDDD/> +<EEEE/> +</AAA> |