xref: /openbsd/gnu/usr.bin/perl/cpan/parent/t/parent-pmc.t (revision cca36db2)
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;
12use Config;
13use lib 't/lib';
14
15plan skip_all => ".pmc are only available with 5.6 and later" if $] < 5.006;
16plan skip_all => ".pmc are disabled in this perl"
17    if $Config{ccflags} =~ /(?<!\w)-DPERL_DISABLE_PMC\b/;
18plan tests => 3;
19
20use vars qw($got_here);
21
22my $res = eval q{
23    package MyTest;
24
25    use parent 'FileThatOnlyExistsAsPMC';
26
27    1
28};
29my $error = $@;
30
31is $res, 1, "Block ran until the end";
32is $error, '', "No error";
33
34my $obj = bless {}, 'FileThatOnlyExistsAsPMC';
35can_ok $obj, 'exclaim';
36