summaryrefslogtreecommitdiffstats
path: root/t/dynamic2.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-01-06 10:28:20 -0600
committerJesse Luehrs <doy@tozt.net>2012-01-06 10:35:56 -0600
commitf37c8c6a403486522d197d9749ab3c7e7d9105ab (patch)
treed2f8f28ef36784169de8cdf5b83f476a51dd6329 /t/dynamic2.t
parent287563c99fd663d619916b60b24ebb60bf08591d (diff)
downloadcircular-require-f37c8c6a403486522d197d9749ab3c7e7d9105ab.tar.gz
circular-require-f37c8c6a403486522d197d9749ab3c7e7d9105ab.zip
not lexical scope, but dynamic scope is close enough i think
Diffstat (limited to 't/dynamic2.t')
-rw-r--r--t/dynamic2.t12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/dynamic2.t b/t/dynamic2.t
new file mode 100644
index 0000000..f1fd093
--- /dev/null
+++ b/t/dynamic2.t
@@ -0,0 +1,12 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+use lib 't/dynamic2';
+
+my $warnings;
+local $SIG{__WARN__} = sub { $warnings .= $_[0] };
+use_ok('Foo');
+is($warnings, "Circular require detected:\n Bar.pm\n Baz.pm\n Bar.pm\n", "correct warnings");
+
+done_testing;