You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ja...@apache.org on 2001/10/07 05:02:16 UTC
cvs commit: xml-xerces/perl/t XMLException.t
jasons 01/10/06 20:02:16
Modified: perl/t XMLException.t
Log:
* t/XMLException.t (Repository):
Added test for getCode()
Added test for XML::Xerces::PerlXMLExceptionHandler::catch()
Revision Changes Path
1.3 +16 -1 xml-xerces/perl/t/XMLException.t
Index: XMLException.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/XMLException.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMLException.t 2001/07/09 15:24:24 1.2
+++ XMLException.t 2001/10/07 03:02:16 1.3
@@ -7,7 +7,7 @@
# Change 1..1 below to 1..last_test_to_print .
# (It may become useful if the test is moved to ./t subdirectory.)
-BEGIN { $| = 1; print "1..2\n"; }
+BEGIN { $| = 1; print "1..4\n"; }
END {print "not ok 1\n" unless $loaded;}
use Carp;
@@ -39,4 +39,19 @@
});
XML::Xerces::LocalFileInputSource->new('../I/AM/NOT/A/FILE');
result($error);
+
+$handler->setXMLExceptionHandler(sub{
+ my $exception = shift;
+ $error = $exception->getCode();
+});
+XML::Xerces::LocalFileInputSource->new('../I/AM/NOT/A/FILE');
+# print STDERR "Got error code: $error\n";
+result($error == 36);
+
+# Now test the XML::Xerces::PerlXMLExceptionHandler::catch() method
+$handler->setXMLExceptionHandler(\&XML::Xerces::PerlXMLExceptionHandler::catch);
+eval {
+ XML::Xerces::LocalFileInputSource->new('../I/AM/NOT/A/FILE');
+};
+result($@);
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org