Debian Codegraph @

inc/Marpa/R2/Test.pm

raw
1 # Copyright 2022 Jeffrey Kegler
2 # This file is part of Marpa::R2. Marpa::R2 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::R2 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::R2. If not, see
14 # http://www.gnu.org/licenses/.
15
16 package Marpa::R2::Test;
17
18 use 5.010001;
19 use strict;
20 use warnings;
21
22 use Data::Dumper;
23
24 Marpa::R2::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 eval 'use Test::Differences';
31 }
32
33 sub Marpa::R2::Test::is {
34 goto &Test::Differences::eq_or_diff
35 if defined &Test::Differences::eq_or_diff && @_ > 1;
36 @_ = map { ref $_ ? Data::Dumper::Dumper(@_) : $_ } @_;
37 goto &Test::More::is;
38 } ## end sub Marpa::R2::Test::is
39
40 1;
41