Skip to content

Commit

Permalink
reproduction case for PR#30 fix
Browse files Browse the repository at this point in the history
When the non-existent URI::javascript is loaded, $@ is left populated.  It is
cleared out the first time by loading URI::_foreign, but the second time
around nothing clears it.
  • Loading branch information
karenetheridge committed Dec 28, 2015
1 parent 23d01eb commit 37dc0db
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Expand Up @@ -96,6 +96,7 @@ t/roytest4.html
t/roytest5.html
t/rsync.t
t/rtsp.t
t/scheme-exceptions.t
t/sip.t
t/sort-hash-query-form.t
t/split.t
Expand Down
16 changes: 16 additions & 0 deletions t/scheme-exceptions.t
@@ -0,0 +1,16 @@
use strict;
use warnings;

use Test::More;
use URI;

plan skip_all => 'this test assumes that URI::javascript does not exist'
if eval 'require URI::javascript';
plan tests => 4;

for (0..1) {
my $uri = URI->new('javascript://foo/bar');

is($@, '', 'no exception when trying to load a scheme handler class');
ok($uri->isa('URI'), 'but URI still instantiated as foreign');
}

0 comments on commit 37dc0db

Please sign in to comment.