Update parent to CPAN version 0.223
[p5sagit/p5-mst-13.2.git] / ext / parent / t / parent-pmc.t
1 #!/usr/bin/perl -w
2 BEGIN {
3     if( $ENV{PERL_CORE} ) {
4         chdir 't' if -d 't';
5         chdir '../lib/parent';
6         @INC = '..';
7     }
8 }
9
10 use strict;
11 use Test::More;
12 use Config;
13 use lib 't/lib';
14
15 plan skip_all => ".pmc are only available with 5.6 and later" if $] < 5.006;
16 plan skip_all => ".pmc are disabled in this perl"
17     if $Config{ccflags} =~ /(?<!\w)-DPERL_DISABLE_PMC\b/;
18 plan tests => 3;
19
20 use vars qw($got_here);
21
22 my $res = eval q{
23     package MyTest;
24
25     use parent 'FileThatOnlyExistsAsPMC';
26
27     1
28 };
29 my $error = $@;
30
31 is $res, 1, "Block ran until the end";
32 is $error, '', "No error";
33
34 my $obj = bless {}, 'FileThatOnlyExistsAsPMC';
35 can_ok $obj, 'exclaim';