match-simple-XS

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
                                          url  => "git://github.com/tobyink/p5-match-simple-xs.git",
                                          web  => "https://github.com/tobyink/p5-match-simple-xs",
                                        },
                        x_identifier => "http://purl.org/NET/cpan-uri/dist/match-simple-XS/project",
                      },
  "version"        => 0.002,
};
 
my %dynamic_config;
do {
        if ( $] lt '5.010' ) {
                $meta->{prereqs}{runtime}{requires}{'MRO::Compat'} = '0';
        }
         
        # Probably a lot of the following is cargo cult.
        # My XS-fu is not strong.
        #
         
        $dynamic_config{LIBS}   = [''];
        $dynamic_config{DEFINE} = '';
        $dynamic_config{INC}    = '-I.';

t/02simple.t  view on Meta::CPAN

95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
my $obj2 = do {
        package Local::SomeOtherClass;
        sub MATCH { $_[1] }
        bless [];
};
does_match(1, $obj2);
doesnt_match(0, $obj2);
 
# If the right hand side is an object which overloads "~~", then a
# true smart match is performed.
if ( $] le '5.036000' ) {
        my $obj3 = eval q{
                no warnings;
                no strict 'refs';
                package Local::YetAnotherClass;
                use overload q[~~] => sub { $_[1] }, fallback => 1;
                bless [];
        };
        my $e = $@;
        ok($obj3, 'eval worked') or diag($e);
        does_match(1, $obj3);



( run in 2.860 seconds using v1.01-cache-2.11-cpan-94b05bcf43c )