Commit | Line | Data |
d3153aa4 |
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; |
b4475de8 |
12 | use Config; |
d3153aa4 |
13 | use lib 't/lib'; |
14 | |
15 | plan skip_all => ".pmc are only available with 5.6 and later" if $] < 5.006; |
b4475de8 |
16 | plan skip_all => ".pmc are disabled in this perl" |
17 | if $Config{ccflags} =~ /(?<!\w)-DPERL_DISABLE_PMC\b/; |
d3153aa4 |
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'; |