|
Revision 2583, 472 bytes
(checked in by mpaschal, 18 months ago)
|
|
Add Test::Deep to t/lib, since we already use it in driver-tests.pl
BugzID: 79953
|
| Line | |
|---|
| 1 | use strict; |
|---|
| 2 | use warnings; |
|---|
| 3 | |
|---|
| 4 | package Test::Deep::Ref; |
|---|
| 5 | |
|---|
| 6 | use Test::Deep::Cmp; |
|---|
| 7 | |
|---|
| 8 | use Scalar::Util qw( blessed ); |
|---|
| 9 | |
|---|
| 10 | sub test_class |
|---|
| 11 | { |
|---|
| 12 | my $self = shift; |
|---|
| 13 | my $got = shift; |
|---|
| 14 | |
|---|
| 15 | my $exp = $self->{val}; |
|---|
| 16 | |
|---|
| 17 | if ($Test::Deep::Snobby) |
|---|
| 18 | { |
|---|
| 19 | return Test::Deep::descend($got, Test::Deep::blessed(blessed($exp))); |
|---|
| 20 | } |
|---|
| 21 | else |
|---|
| 22 | { |
|---|
| 23 | return 1; |
|---|
| 24 | } |
|---|
| 25 | } |
|---|
| 26 | |
|---|
| 27 | sub test_reftype |
|---|
| 28 | { |
|---|
| 29 | my $self = shift; |
|---|
| 30 | my $got = shift; |
|---|
| 31 | my $reftype = shift; |
|---|
| 32 | |
|---|
| 33 | return Test::Deep::descend($got, Test::Deep::reftype($reftype)); |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | 1; |
|---|