summaryrefslogtreecommitdiffstats
path: root/t/hidden_cycle.t
blob: 39d03bceab723dc9428e8e046d78294880cf3bdf (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/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 in 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;