|
From: Petr P. <pa...@us...> - 2003-04-02 14:15:59
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext/t
In directory sc8-pr-cvs1:/tmp/cvs-serv20826/t
Modified Files:
00-xpathcontext.t
Log Message:
- tests for XPathContext with NULL/undef context node
Index: 00-xpathcontext.t
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/t/00-xpathcontext.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- 00-xpathcontext.t 26 Mar 2003 21:21:40 -0000 1.4
+++ 00-xpathcontext.t 2 Apr 2003 14:15:55 -0000 1.5
@@ -1,5 +1,5 @@
use Test;
-BEGIN { plan tests => 17 };
+BEGIN { plan tests => 21 };
use XML::LibXML;
use XML::LibXML::XPathContext;
@@ -64,3 +64,12 @@
my $xc3 = XML::LibXML::XPathContext->new($doc2->getDocumentElement);
$xc3->find('/');
ok($xc3->getContextNode->toString() eq '<foo><bar/></foo>');
+
+# check starting with empty context
+my $xc4 = XML::LibXML::XPathContext->new();
+ok(!defined($xc4->getContextNode));
+eval { $xc4->find('/') };
+ok($@);
+$xc4->setContextNode($doc2->getDocumentElement);
+ok($xc4->find('/'));
+ok($xc4->getContextNode->isSameNode($doc2->getDocumentElement));
|