From 37dc0db9a0efc40c1501ca118c968d9328d47ca4 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Mon, 28 Dec 2015 15:43:01 -0800 Subject: 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. --- t/scheme-exceptions.t | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 t/scheme-exceptions.t (limited to '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'); +} -- cgit v1.2.1