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