HEX
Server: Apache
System: Linux server-674799.igrow.ws 5.14.0-611.30.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 11 06:42:00 EST 2026 x86_64
User: elrashedytravel (1025)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/.cpan/build/URI-5.29-0/t/roy-test.t
use strict;
use warnings;

use Test::More tests => 102;

use URI ();
use File::Spec::Functions qw( catfile );

my $no = 1;

my @prefix;
push(@prefix, "t") if -d "t";

for my $i (1..5) {
   my $file = catfile(@prefix, "roytest$i.html");

   open(FILE, $file) || die "Can't open $file: $!";
   note $file;
   my $base = undef;
   while (<FILE>) {
       if (/^<BASE href="([^"]+)">/) {
           $base = URI->new($1);
       } elsif (/^<a href="([^"]*)">.*<\/a>\s*=\s*(\S+)/) {
           die "Missing base at line $." unless $base;
           my $link = $1;
           my $exp  = $2;
           $exp = $base if $exp =~ /current/;  # special case test 22

	   # rfc2396bis restores the rfc1808 behaviour
	   if ($no == 7) {
	       $exp = "http://a/b/c/d;p?y";
           }
	   elsif ($no == 48) {	
	       $exp = "http://a/b/c/d;p?y";
	   }

	   is(URI->new($link)->abs($base), $exp);

           $no++;
       }
   }
   close(FILE);
}