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: 43371
Status: resolved
Priority: 0/
Queue: Test-Deep

People
Owner: Nobody in particular
Requestors: clayton.magouyrk [...] gmail.com
Cc:
AdminCc:

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



Subject: Test::Deep dies
Date: Tue, 17 Feb 2009 13:35:56 -0800
To: bug-test-deep [...] rt.cpan.org
From: Clayton Magouyrk <clayton.magouyrk [...] gmail.com>
First I want to say thank you for this great module - it's a very useful pattern matching tool. I was performing some unit tests and I ran across what I consider to be a bug: $ perl -e 'use Test::Deep; cmp_deeply("string", array_each("string"));' Can't use string ("string") as an ARRAY ref while "strict refs" in use at /imdb/tools/2.65/lib/perl5/5.8.8/Test/Deep/ArrayEach.pm line 22. # Looks like your test died before it could output anything. This seems to be contrary to what the documentation says: my $common_tests = all( isa("MyFile"), methods( handle => isa("IO::Handle") filename => re("^/home/ted/tmp"), ) ); cmp_deeply($got, array_each($common_tests)); is similar to foreach my $got_v (@$got) { cmp_deeply($got_v, $common_tests) } Except it will not explode is $got is not an array reference. Looks like the issue could be resolved by something as simple as: my $exp = [ ($self->{val}) x (reftype($got) eq 'ARRAY' ? @$got : 1) ]; Which would just shove the validation down a level, where it would fail (just a guess - there may be other assumed preconditions later on that are violated). Thanks, Clay Magouyrk
Thanks for the report. I missed it in my inbox and just found it now. You're right, it should not explode. I will look into fixing that but I have very little time to spend on Test::Deep these days so it could be some time, F
Subject: Re: [rt.cpan.org #43371] Test::Deep dies
Date: Thu, 5 Mar 2009 17:23:40 -0800
To: bug-Test-Deep [...] rt.cpan.org
From: Clayton Magouyrk <clayton.magouyrk [...] gmail.com>
Thanks for the reply. It's a non blocker for me - your design of Test::Deep made it possible for me to write my own ArrayEach implementation (as well as several other useful extensions) which I am using. Clay On Thu, Mar 5, 2009 at 3:03 PM, FDALY via RT <bug-Test-Deep@rt.cpan.org>wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=43371 > > > Thanks for the report. I missed it in my inbox and just found it now. > You're right, it should not explode. I will look into fixing that but I > have very little time to spend on Test::Deep these days so it could be > some time, > > F >
I believe this is fixed by: https://github.com/rjbs/Test-Deep/commit/e855a0b1e2c96cec155a9d0cefa8480704a80498 I will release that in a few days, after hopefully making some other fixes. Objections welcome! :) -- rjbs