xref: /openbsd-src/gnu/usr.bin/perl/cpan/parent/t/parent-returns-false.t (revision f3efcd0145415b7d44d9da97e0ad5c21b186ac61)
1#!/usr/bin/perl -w
2BEGIN {
3    if( $ENV{PERL_CORE} ) {
4        chdir 't' if -d 't';
5        chdir '../lib/parent';
6        @INC = '..';
7    }
8}
9
10use strict;
11use Test::More tests => 2;
12use lib 't/lib';
13
14our $got_here;
15
16my $res = eval q{
17    package MyTest;
18
19    use parent 'ReturnsFalse';
20
21    $main::got_here++
22};
23my $error = $@;
24
25is $got_here, undef, "The block did not run to its end.";
26like $error, q{/^ReturnsFalse.pm did not return a true value at /}, "A module that returns a false value raises an error";
27