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/scheme-exceptions.t
use strict;
use warnings;

use Test::More;
use URI ();

require URI::_foreign;    # load this before disabling @INC
my $count = 0;
local @INC = (sub { ++$count; return });
for (0 .. 1) {
    my $uri = URI->new('notreal://foo/bar');
    is($count, 1,  'only attempt to load the scheme package once');
    is($@,     '', 'no exception when trying to load a scheme handler class');
    ok($uri->isa('URI'), 'but URI still instantiated as foreign');
    diag $count;
}

done_testing;