summaryrefslogtreecommitdiffstats
path: root/t/hide_middleman3.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-01-04 16:40:10 -0600
committerJesse Luehrs <doy@tozt.net>2012-01-04 16:40:10 -0600
commit73b6d62558003113da61a5e5926ea67aa47c6ae5 (patch)
treea0313a65c21ee67e6e90ea7fc30e2ab63b01bf1d /t/hide_middleman3.t
parent8322efee06fbf44b8a8fa3717f933bae3632073d (diff)
downloadcircular-require-73b6d62558003113da61a5e5926ea67aa47c6ae5.tar.gz
circular-require-73b6d62558003113da61a5e5926ea67aa47c6ae5.zip
don't hang if all packages are hidden
Diffstat (limited to 't/hide_middleman3.t')
-rw-r--r--t/hide_middleman3.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/hide_middleman3.t b/t/hide_middleman3.t
new file mode 100644
index 0000000..bbd920f
--- /dev/null
+++ b/t/hide_middleman3.t
@@ -0,0 +1,26 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use lib 't/hide_middleman';
+use Test::More;
+
+no circular::require -hide => [
+ qw(base Foo Bar main circular::require),
+ (map { my $m = $_; $m =~ s+/+::+g; $m =~ s/\.pm$//; $m } keys %INC),
+];
+
+my @warnings;
+
+{
+ $SIG{__WARN__} = sub { push @warnings => @_ };
+
+ use_ok( 'Foo' );
+}
+
+is_deeply(
+ \@warnings,
+ ["Circular require detected: Foo.pm (from <unknown package>)\n"],
+ "don't loop infinitely if all packages are hidden"
+);
+
+done_testing;