summaryrefslogtreecommitdiffstats
path: root/t/long_cycle.t
blob: fb0c703944f7f80c49db2a73b84d21a3dc5efa3d (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 Test::More;
use lib 't/long_cycle';

no circular::require;

my @warnings;

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

    use_ok( 'Foo' );
}

is_deeply(
    \@warnings,
    ["Circular require detected:\n  Bar.pm\n  Baz.pm\n  Quux.pm\n  Blorg.pm\n  Bar.pm\n"],
    "detection of longer cycles"
);

done_testing;