summaryrefslogtreecommitdiffstats
path: root/t/hide_middleman.t
blob: 72fa9c6840e2d5382d7bad4dde139ffa3c727188 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env perl
use strict;
use warnings;
use lib 't/hide_middleman';
use Test::More;

no circular::require -hide => 'base';

my @warnings;

{
    $SIG{__WARN__} = sub { push @warnings => @_ };

    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;