Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Deep CPAN distribution.

Report information
The Basics
Id: 78378
Status: resolved
Priority: 0/
Queue: Test-Deep

People
Owner: Nobody in particular
Requestors: MVUETS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.110
Fixed in: (no value)



Subject: array_each() carps being fed with a non-ref
Here is a self-explanatory example: $ perl -MTest::Deep -e 'cmp_deeply {a=>"foo"}, {a=>array_each(ignore())}' Use of uninitialized value in string eq at /home/mvuets/perl5/lib/perl5/Test/Deep/ArrayEach.pm line 23. not ok 1 # Failed test at -e line 1. # Compared $data->{"a"} # got : 'foo' # expect : [ Test::Deep::Ignore=HASH(0x129cc88), ... ] # Tests were run but no plan was declared and done_testing() was not seen. Here is a patch: --- a/ArrayEach.pm +++ b/ArrayEach.pm @@ -20,7 +20,7 @@ my $self = shift; my $got = shift; - return unless Scalar::Util::reftype($got) eq 'ARRAY'; + return unless ref $got && Scalar::Util::reftype($got) eq 'ARRAY'; my $exp = [ ($self->{val}) x @$got ]; return Test::Deep::descend($got, $exp);
Thanks, I have applied this and it will be in an upcoming release. -- rjbs