-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The existing code falls back to URI::urn and already caches the implementor after it's done. It therefore can never try to load one twice if it previously failed.
- Loading branch information
Showing
2 changed files
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More; | ||
use URI::urn; | ||
|
||
plan tests => 6; | ||
|
||
{ | ||
require URI::_foreign; # load this before disabling @INC | ||
my $count = 0; | ||
local @INC = sub { $count++; return }; | ||
for ( 0 .. 1 ) { | ||
my $uri = URI->new('urn:asdfasdf:1.2.3.4.5.6.7.8.9.10'); | ||
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' ); | ||
} | ||
} |