| 1 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | # this is for people who don't want Test::Builder to be loaded but want to | ||
| 5 | # use eq_deeply. It's a bit hacky... | ||
| 6 | |||
| 7 | package Test::Deep::NoTest 1.205; | ||
| 8 | # ABSTRACT: Use Test::Deep outside of the testing framework | ||
| 9 | |||
| 10 | 3 | our $NoTest; | |
| 11 | |||
| 12 | { | ||
| 13 | 3 | local $NoTest = 1; | |
| 14 | 3 | require Test::Deep; | |
| 15 | } | ||
| 16 | |||
| 17 | 3 | ▶ | sub import { |
|
Subroutine
import: called CC=1 SCAR=0.0
| |||
| 18 | 3 | my $import = Test::Deep->can("import"); | |
| 19 | # make the stack look like it should for use Test::Deep | ||
| 20 | 3 | my $pkg = shift; | |
| 21 | 3 | unshift(@_, "Test::Deep"); | |
| 22 | 3 | push @_, '_notest'; | |
| 23 | 3 | goto &$import; | |
| 24 | } | ||
| 25 | |||
| 26 | 3 | 1; | |
| 27 | |||
| 28 | #pod =head1 SYNOPSIS | ||
| 29 | #pod | ||
| 30 | #pod use Test::Deep::NoTest; | ||
| 31 | #pod | ||
| 32 | #pod if (eq_deeply($a, $b)) { | ||
| 33 | #pod print "they were deeply equal\n"; | ||
| 34 | #pod } | ||
| 35 | #pod | ||
| 36 | #pod =head1 DESCRIPTION | ||
| 37 | #pod | ||
| 38 | #pod This exports all the same things as Test::Deep but it does not load | ||
| 39 | #pod Test::Builder so it can be used in ordinary non-test situations. | ||
| 40 | |||
| 41 | __END__ | ||