summaryrefslogtreecommitdiff
path: root/t/both-fail.t
blob: e21cb787849f379dd2c028bfe66728841c6f0a68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use strict;
use warnings;

use Test::More 0.88;
use Test::Fatal 0.006;

{
    package T;

    use strict;
    use warnings;

    use lib 't/lib';

    use Module::Implementation;
    my $loader = Module::Implementation::build_loader_sub(
        implementations => [ 'ImplFails1', 'ImplFails2' ],
        symbols         => [qw( return_42 )],
    );

    ::like(
        ::exception{ $loader->() },
        qr/Could not find a suitable T implementation/,
        'Got an exception when all implementations fail to load'
    );
}

done_testing();