Test-Deep as_test_deep_cmp branch
Ricardo Signes <[email protected]> Sun, 18 Dec 2016 09:08:23 -0500
| Newsgroups | gmane.comp.lang.perl.quality-assurance |
|---|---|
| Message-ID | <20161218140823.GA8199@debian> |
--LQksG6bCIzRHxTLp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I've filed a PR against Test-Deep: https://github.com/rjbs/Test-Deep/pull/52 addresses https://github.com/rjbs/Test-Deep/issues/50 The idea is: When you call cmp_deeply($have, $want), objects found in $want are either Test::Deep::Cmp objects or not. If they are, they do their special test ma= gic. If they are not, they are more or less compared to the data in $have without respect to blessing. For example, a blessed hashref in $want is compared to the matching data in $have for keys and values. With my changes, objects in $want are checked for a as_test_deep_cmp method, which can be called to return a Test::Deep::Cmp to be used instead of the object. I expect this to be rarely, but sometimes, useful. Issue #50 goes into the details of why it came up. In that, I mention using this with JSON::Typist/Test::Deep::JType. I have implemented the described feature at https://github.com/rjbs/JSON-Typist/pull/2 I'm interested in any thoughts on this before I make a trial release. --=20 rjbs --LQksG6bCIzRHxTLp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJYVphXAAoJEOYby6cMccU5W/wH/3eYWgmPZ0l9rX8Wo/gLpwQz X+fCEOZ8NSxEtSHJq6ws9pAsqn2wZ+U8xPVy8u/U4KYnjOthHHwCAxTBER3JFQJp gyMwVCNkPyAhE6Kec3Ebn/o+l1KC1LJeA9xPAL8cb+DKEQdL7+i3sLPh2nXD9J5U KQoQBXEyWks2HvUcarNRdjIZRYltIVz0I5Id8JfwNFQcb4HNm4L8UKE5i52Q+N5f 15p6oNh5yhOPoDxeUYUNDeVNpfghZbeXRuIsYik54W2sMFbZSiyIQSdxVim74iUq peD9VtLerO2B7dRlRpyYxq0mRgJhuVCCKhul2KIh0x/Hc9hufnTJdb9i4Y0DTSI= =Kadw -----END PGP SIGNATURE----- --LQksG6bCIzRHxTLp--