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 2002/04/25 03:50:20 UTC
cvs commit: xml-xerces/perl/t XMLURL.t
jasons 02/04/24 18:50:20
Modified: perl/t XMLURL.t
Log:
* t/XMLURL.t (Repository):
Added new query test
Revision Changes Path
1.2 +13 -14 xml-xerces/perl/t/XMLURL.t
Index: XMLURL.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/XMLURL.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XMLURL.t 10 Oct 2001 19:41:16 -0000 1.1
+++ XMLURL.t 25 Apr 2002 01:50:20 -0000 1.2
@@ -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..26\n"; }
+BEGIN { $| = 1; print "1..27\n"; }
END {print "not ok 1\n" unless $loaded;}
use Carp;
# use blib;
@@ -81,17 +81,13 @@
my $user = 'me';
my $password = 'metoo';
my $base = "$proto://$user:$password\@$host:$port/";
-my $path = '/test/samples.html';
+my $path = '/test/samples.pl';
+$query = 'bar';
my $fragment = 'foo';
-my $xml_url3;
-eval {
- $xml_url3 = XML::Xerces::XMLURL->new($base, "$path#$fragment");
-};
-if ($@) {
- die $@->getMessage()
- if ref($@);
- die $@;
-}
+my $url_text = "$path?$query#$fragment";
+my $xml_url3 = eval{XML::Xerces::XMLURL->new($base, $url_text)};
+XML::Xerces::error($@) if $@;
+
result(is_object($xml_url)
&& $xml_url->isa('XML::Xerces::XMLURL')
);
@@ -99,13 +95,16 @@
# test getFragment
result($xml_url3->getFragment() eq $fragment);
+# test getQuery
+result($xml_url3->getQuery() eq $query);
+
# test getPath
result($xml_url3->getPath() eq $path);
# test getURLText
$URL = $base;
$URL =~ s|/$||;
-$URL .= "$path#$fragment";
+$URL .= $url_text;
result($xml_url3->getURLText() eq $URL);
# test getPortNum
@@ -164,9 +163,9 @@
result(!$xml_url3->isRelative());
# test overloaded setURL with XMLURL for base
-$xml_url2->setURL($xml_url,"$path#$fragment");
+$xml_url2->setURL($xml_url,$url_text);
result($xml_url2->getURLText() eq $URL);
# test overloaded setURL with string for base
-$xml_url3->setURL($base,"$path#$fragment");
+$xml_url3->setURL($base,$url_text);
result($xml_url3->getURLText() eq $URL);
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org