summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/cpan/parent/t/parent-returns-false.t
blob: 3eabf5377e06c7183714cf9114aa58c70754cc86 (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
24
25
26
#!/usr/bin/perl -w
BEGIN {
    if( $ENV{PERL_CORE} ) {
        chdir 't' if -d 't';
        chdir '../lib/parent';
        @INC = '..';
    }
}

use strict;
use Test::More tests => 2;
use lib 't/lib';

our $got_here;

my $res = eval q{
    package MyTest;

    use parent 'ReturnsFalse';

    $main::got_here++
};
my $error = $@;

is $got_here, undef, "The block did not run to its end.";
like $error, q{/^ReturnsFalse.pm did not return a true value at /}, "A module that returns a false value raises an error";