summaryrefslogtreecommitdiffstats
path: root/t/hidden_cycle.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-01-04 18:02:30 -0600
committerJesse Luehrs <doy@tozt.net>2012-01-04 18:02:30 -0600
commitea2dd4c149d78e54c66a3400d2b0ecec5c959a40 (patch)
treec2d97880439669968a75757b005e8c9527c34613 /t/hidden_cycle.t
parent79b443187ee06d8ee7eedc29012e2b68235e3cd1 (diff)
downloadcircular-require-ea2dd4c149d78e54c66a3400d2b0ecec5c959a40.tar.gz
circular-require-ea2dd4c149d78e54c66a3400d2b0ecec5c959a40.zip
if an entire cycle is hidden, don't show something from outside of it
Diffstat (limited to 't/hidden_cycle.t')
-rw-r--r--t/hidden_cycle.t23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/hidden_cycle.t b/t/hidden_cycle.t
new file mode 100644
index 0000000..a2b33f1
--- /dev/null
+++ b/t/hidden_cycle.t
@@ -0,0 +1,23 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use lib 't/hidden_cycle';
+use Test::More;
+
+no circular::require -hide => [qw(Bar Baz)];
+
+my @warnings;
+
+{
+ $SIG{__WARN__} = sub { push @warnings => @_ };
+
+ use_ok( 'Foo' );
+}
+
+is_deeply(
+ \@warnings,
+ ["Circular require detected: Bar.pm (from <unknown file>)\n"],
+ "hiding all packages in the cycle shouldn't report a package outside of the cycle as being the source"
+);
+
+done_testing;