diff options
author | Karen Etheridge <ether@cpan.org> | 2015-12-28 15:43:01 -0800 |
---|---|---|
committer | Karen Etheridge <ether@cpan.org> | 2015-12-28 15:47:29 -0800 |
commit | 37dc0db9a0efc40c1501ca118c968d9328d47ca4 (patch) | |
tree | 737d3e0be2a47d5093133edae4436a8ad51460d2 | |
parent | 23d01ebb7dcdd7d81284ed175a52e461853bef54 (diff) | |
download | uri-37dc0db9a0efc40c1501ca118c968d9328d47ca4.tar.gz |
reproduction case for PR#30 fix
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.
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | t/scheme-exceptions.t | 16 |
2 files changed, 17 insertions, 0 deletions
@@ -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 diff --git a/t/scheme-exceptions.t b/t/scheme-exceptions.t new file mode 100644 index 0000000..2654d3f --- /dev/null +++ b/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'); +} |