From: Petr P. <pa...@us...> - 2003-03-21 20:21:14
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext/t In directory sc8-pr-cvs1:/tmp/cvs-serv3691/t Modified Files: 02-functions.t Log Message: - fixed bug with wrong owner assignment for non-context document nodes - regression test for non-context document nodes added Index: 02-functions.t =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/t/02-functions.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- 02-functions.t 21 Mar 2003 16:27:49 -0000 1.4 +++ 02-functions.t 21 Mar 2003 20:11:02 -0000 1.5 @@ -1,6 +1,6 @@ # -*- cperl -*- use Test; -BEGIN { plan tests => 22 }; +BEGIN { plan tests => 23 }; use XML::LibXML; use XML::LibXML::XPathContext; @@ -67,12 +67,13 @@ $xc->registerFunction('new-chunk', sub { - XML::LibXML->new->parse_string('<x><a/><a/><a/></x>')->find('//*') + XML::LibXML->new->parse_string('<x><y><a/><a/></y><y><a/></y></x>')->find('//a') }); -ok($xc->findnodes('new-chunk()')->size() == 4); +ok($xc->findnodes('new-chunk()')->size() == 3); my ($x)=$xc->findnodes('new-chunk()/parent::*'); -ok($x->nodeName() eq 'x'); -ok($xc->findvalue('name(new-chunk()/parent::*)') eq 'x'); +ok($x->nodeName() eq 'y'); +ok($xc->findvalue('name(new-chunk()/parent::*)') eq 'y'); +ok($xc->findvalue('count(new-chunk()/parent::*)=2')); my $largedoc=XML::LibXML->new->parse_string('<a>'.('<b/>' x 3000).'</a>'); $xc->setContextNode($largedoc); |