File Coverage

tool/lib/Marpa/PP/Test.pm
Criterion Covered Total %
statement 18 20 90.0
branch 2 4 50.0
condition 1 3 33.3
subroutine 7 7 100.0
pod 0 1 0.0
total 28 35 80.0


line stmt bran cond sub pod time code
1             # Copyright 2012 Jeffrey Kegler
2             # This file is part of Marpa::PP. Marpa::PP is free software: you can
3             # redistribute it and/or modify it under the terms of the GNU Lesser
4             # General Public License as published by the Free Software Foundation,
5             # either version 3 of the License, or (at your option) any later version.
6             #
7             # Marpa::PP is distributed in the hope that it will be useful,
8             # but WITHOUT ANY WARRANTY; without even the implied warranty of
9             # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10             # Lesser General Public License for more details.
11             #
12             # You should have received a copy of the GNU Lesser
13             # General Public License along with Marpa::PP. If not, see
14             # http://www.gnu.org/licenses/.
15              
16             package Marpa::PP::Test;
17              
18 37     37   2211630 use 5.010;
  37         169  
  37         2192  
19 37     37   213 use strict;
  37         69  
  37         1143  
20 37     37   198 use warnings;
  37         89  
  37         1373  
21              
22 37     37   69285 use Data::Dumper;
  37         570128  
  37         6731  
23              
24             Marpa::PP::exception('Test::More not loaded')
25             if not defined &Test::More::is;
26              
27             BEGIN {
28             ## no critic (BuiltinFunctions::ProhibitStringyEval)
29             ## no critic (ErrorHandling::RequireCheckingReturnValueOfEval)
30 37     37   2495 eval 'use Test::Differences';
  37     37   27866  
  0         0  
  0         0  
31             }
32              
33             sub Marpa::PP::Test::is {
34 162 50 33 162 0 28944 goto &Test::Differences::eq_or_diff
35             if defined &Test::Differences::eq_or_diff && @_ > 1;
36 162 50       398 @_ = map { ref $_ ? Data::Dumper::Dumper(@_) : $_ } @_;
  486         1680  
37 162         1252 goto &Test::More::is;
38             } ## end sub Marpa::PP::Test::is
39              
40             1;
41