| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 
 | #!/usr/bin/perl
use v5.14;
use warnings;
use Test2::V0;
BEGIN {
   $^V ge v5.38 or
      plan skip_all => "Not supported on Perl $^V";
}
use meta;
no warnings qw( meta::experimental );
use feature 'class';
no warnings qw( experimental::class );
package NotAClass {
   sub not_a_method {}
}
class IsAClass {
   sub not_a_method {}
   method is_a_method {}
}
# ->is_class
{
   ok( !meta::package->get( "NotAClass" )->is_class,
      'metapkg for non-class is not a class' );
   ok( meta::package->get( "IsAClass" )->is_class,
      'metapkg for class is a class' );
}
# ->is_method
{
   my $metapkg = meta::package->get( "IsAClass" );
   ok( !$metapkg->get_symbol( '¬_a_method' )->is_method,
      'metasub for not_a_method is not a method' );
   ok( $metapkg->get_symbol( '&is_a_method' )->is_method,
      'metasub for is_a_method is a method' );
}
done_testing;
 |