Update of /cvsroot/perl-xml/XML-LibXML-XPathContext/t
In directory sc8-pr-cvs1:/tmp/cvs-serv22150/t
Modified Files:
00-xpathcontext.t
Log Message:
added lookupNs method
Index: 00-xpathcontext.t
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/t/00-xpathcontext.t,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- 00-xpathcontext.t 21 May 2003 10:17:35 -0000 1.8
+++ 00-xpathcontext.t 29 May 2003 14:28:28 -0000 1.9
@@ -1,5 +1,5 @@
use Test;
-BEGIN { plan tests => 28 };
+BEGIN { plan tests => 30 };
use XML::LibXML;
use XML::LibXML::XPathContext;
@@ -38,11 +38,13 @@
my $xc = XML::LibXML::XPathContext->new($doc1);
$xc->registerNs('xxx', 'http://example.com/foobar');
ok($xc->findnodes('/xxx:foo')->pop->nodeName eq 'foo');
+ok($xc->lookupNs('xxx') eq '/xxx:foo');
# test unregisterNs()
$xc->unregisterNs('xxx');
eval { $xc->findnodes('/xxx:foo') };
ok($@);
+ok(!defined($xc->lookupNs('xxx')));
# test getContextNode and setContextNode
ok($xc->getContextNode->isSameNode($doc1));
|