From: Petr P. <pa...@us...> - 2003-04-11 16:39:36
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext/t In directory sc8-pr-cvs1:/tmp/cvs-serv2279/t Modified Files: 00-xpathcontext.t Log Message: Index: 00-xpathcontext.t =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/t/00-xpathcontext.t,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- 00-xpathcontext.t 4 Apr 2003 18:42:58 -0000 1.6 +++ 00-xpathcontext.t 11 Apr 2003 16:39:31 -0000 1.7 @@ -1,5 +1,5 @@ use Test; -BEGIN { plan tests => 23 }; +BEGIN { plan tests => 27 }; use XML::LibXML; use XML::LibXML::XPathContext; @@ -76,4 +76,12 @@ ok($xc4->getContextNode->isSameNode($doc2->getDocumentElement)); $cn=undef; ok($xc4->getContextNode); +ok($xc4->getContextNode->isSameNode($doc2->getDocumentElement)); + +# check temporarily changed context node +my ($bar)=$xc4->findnodes('foo/bar',$doc2); +ok($bar->nodeName eq 'bar'); +ok($xc4->getContextNode->isSameNode($doc2->getDocumentElement)); + +ok($xc4->findnodes('parent::*',$bar)->pop->nodeName eq 'foo'); ok($xc4->getContextNode->isSameNode($doc2->getDocumentElement)); |