diff options
Diffstat (limited to 't/hide_middleman.t')
-rw-r--r-- | t/hide_middleman.t | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/hide_middleman.t b/t/hide_middleman.t new file mode 100644 index 0000000..d0cf652 --- /dev/null +++ b/t/hide_middleman.t @@ -0,0 +1,22 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use lib 't/hide_middleman'; +use Test::More; +use Test::Exception; + +my @warnings; +$SIG{__WARN__} = sub { push @warnings => @_ }; + +# Test passes if you comment this out +no circular::require hide => 'base'; + +use_ok( 'Foo' ); + +is_deeply( + \@warnings, + ["Circular require detected: Foo.pm (from Bar)\n"], + "Show the module that used base, instead of 'base' when a cycle occurs from a use base." +); + +done_testing; |