summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorKaren Etheridge <ether@cpan.org>2015-12-28 15:43:01 -0800
committerKaren Etheridge <ether@cpan.org>2015-12-28 15:47:29 -0800
commit37dc0db9a0efc40c1501ca118c968d9328d47ca4 (patch)
tree737d3e0be2a47d5093133edae4436a8ad51460d2 /t
parent23d01ebb7dcdd7d81284ed175a52e461853bef54 (diff)
downloaduri-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.
Diffstat (limited to 't')
-rw-r--r--t/scheme-exceptions.t16
1 files changed, 16 insertions, 0 deletions
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');
+}