summaryrefslogtreecommitdiffstats
path: root/t/long_cycle.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-01-06 01:14:29 -0600
committerJesse Luehrs <doy@tozt.net>2012-01-06 01:15:25 -0600
commitd0719e8ad715588446409155d68fd1783486aa69 (patch)
tree71121b793602fba6ffad170dba646cc882bf4e3b /t/long_cycle.t
parentde76247745ea63176649888b4ef40be01ce3cd16 (diff)
downloadcircular-require-d0719e8ad715588446409155d68fd1783486aa69.tar.gz
circular-require-d0719e8ad715588446409155d68fd1783486aa69.zip
show the entire cycle in the warning0.06
Diffstat (limited to 't/long_cycle.t')
-rw-r--r--t/long_cycle.t23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/long_cycle.t b/t/long_cycle.t
new file mode 100644
index 0000000..fb0c703
--- /dev/null
+++ b/t/long_cycle.t
@@ -0,0 +1,23 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+use lib 't/long_cycle';
+
+no circular::require;
+
+my @warnings;
+
+{
+ $SIG{__WARN__} = sub { push @warnings => @_ };
+
+ use_ok( 'Foo' );
+}
+
+is_deeply(
+ \@warnings,
+ ["Circular require detected:\n Bar.pm\n Baz.pm\n Quux.pm\n Blorg.pm\n Bar.pm\n"],
+ "detection of longer cycles"
+);
+
+done_testing;