jasons 2002/10/19 16:00:44
Modified: perl/t XMLURL.t
Log:
* t/XMLURL.t (Repository):
equality operator stopped working
added test to match output of URL
Revision Changes Path
1.3 +9 -20 xml-xerces/perl/t/XMLURL.t
Index: XMLURL.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/XMLURL.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMLURL.t 25 Apr 2002 01:50:20 -0000 1.2
+++ XMLURL.t 19 Oct 2002 23:00:44 -0000 1.3
@@ -10,7 +10,7 @@
BEGIN { $| = 1; print "1..27\n"; }
END {print "not ok 1\n" unless $loaded;}
use Carp;
-# use blib;
+use blib;
use XML::Xerces;
use lib 't';
@@ -42,34 +42,23 @@
# test the supported protocols
foreach my $proto (qw(ftp file http)) {
$URL = "$proto://www.openinformatics.com/test/samples.pl?$query";
- eval {
- $xml_url = XML::Xerces::XMLURL->new($URL);
- };
- if ($@) {
- die $@->getMessage()
- if ref($@);
- die $@;
- }
+ $xml_url = eval {XML::Xerces::XMLURL->new($URL)};
+ XML::Xerces::error($@) if $@;
result(is_object($xml_url)
&& $xml_url->isa('XML::Xerces::XMLURL')
)
}
# test the copy constructor
my $xml_url2;
-eval {
- $xml_url2 = XML::Xerces::XMLURL->new($xml_url);
-};
-if ($@) {
- die $@->getMessage()
- if ref($@);
- die $@;
-}
-result(is_object($xml_url)
- && $xml_url->isa('XML::Xerces::XMLURL')
+$xml_url2 = eval {XML::Xerces::XMLURL->new($xml_url)};
+XML::Xerces::error($@) if $@;
+
+result(is_object($xml_url2)
+ && $xml_url2->isa('XML::Xerces::XMLURL')
);
# test getQuery
-result($xml_url->getQuery() eq $query);
+result($xml_url2->getQuery() eq $query);
# test the equality operator
result($xml_url == $xml_url2);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]