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

People
Owner: Nobody in particular
Requestors: zefram [...] fysh.org
Cc:
AdminCc:

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



Subject: T:D:Any overloads the wrong operator
Date: Wed, 14 Nov 2012 14:51:42 +0000
To: bug-Test-Deep [...] rt.cpan.org
From: Zefram <zefram [...] fysh.org>
Both of these tests should fail: perl -lwe 'use Test::More; use Test::Deep; cmp_deeply "a", re(qr/[ab]/) & re(qr/z/); cmp_deeply "a", (re(qr/a/) | re(qr/b/)) & re(qr/z/); done_testing()' not ok 1 # Failed test at -e line 1. # Using Regexp on (Part 2 of 2 in $data) # got : 'a' # expect : (?-xism:z) ok 2 1..2 # Looks like you failed 1 test of 2. The bug here is that Test::Deep::Any has overloaded "&", making "($a | $b) & $c" on comparators act as "$a | $b | $c". Obviously it intended to overload "|" instead. Actually, as I've reported separately, these overloads are faulty anyway because they modify their operands. I believe fixing that will require removing the overload from Test::Deep::Any entirely. I'm reporting this separately in case for some reason the overload doesn't get removed. -zefram