Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

  (email not shown publicly)
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Monday August 04, 2008
03:14 AM

Developer Versions Rock!

[ #37089 ]

The patch I accepted for Test::Differences which allows one to compare string/numeric values in hashrefs has a very, very nasty bug. This now passes:

use Test::More 'no_plan';
use Test::Differences;
diag $Test::Differences::VERSION;

eq_or_diff   { foo => 1 },   { foo => 1 }, 'oops!';
eq_or_diff [ { foo => 1 } ], { foo => 1 }, 'oops!';

Sigh. Good thing this is a development version.

If anyone cares to take a gander at it, I'd be grateful. I'm back to work and may not get to this right away. I'm thinking about forcing it to use &Test::More::is_deeply for the actual test and only do the diff if that fails. That might change how some things look in test results, but should tremendously simplify the internals.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Sorry about the flawed patch.

    When I saw it the other day, it didn't look familiar, and then I noticed that I submitted it about 4 years ago.

    • Heh. No worries. It's not obvious that it's flawed and frankly, if it weren't for a typo in my test suite, I never would have noticed. I'd be astonished if you recalled code from four years ago :) Besides, I'm just damned grateful that there's a patch in the first place.

      And I don't see what's wrong, either (but IIRC, _flatten() is returning an aref without an embedded hashref for the AoH, but I'm not sure and don't have time to fix this today. As a result, we've downgraded.)

  • (but possibly I'm misunderstanding a limitation of T::D). With 0.47, for instance, I get

      perl -MTest::More=tests,1 -MTest::Differences
          -e'eq_or_diff [a => 1], [{a => 1}], "oops"'
      ok 1 - oops

    which is just as wrong. It happens because _flatten treats hashes as equivalent to arrays, and an array of one element as equivalent to a scalar.

    • Hmm, I'll try to look into this later, then. I must have screwed up somewhere and Mark Stosberg is off the hook :)