Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
There's a nasty bug in the latest development version of Test::Differences. By applying a patch which allows this to pass (it currently won't): eq_or_diff { foo => 1 }, { foo => '1' };It also allows this to pass: eq_or_diff [ { foo => 1 } ], { foo => '1' };Ow, ow, ow. This is terrible. Fortunately, that's what development versions are for. I'm thinking about rewriting Test::Differences to use &Test::More::is_deeply for the test and only diff if there are differences. Currently it uses Data::Dumper or its own internal flattening and and compares the string outputs. There are two side-effects I can think of. First, the string/numeric value comparison will work correctly. Second, the 'Array of HashRef' diff output will change dramatically. There's an internal hack which assumes an AoH is a table (likely pulled from DBI, I assume), and this:
Generates this:
I find this much harder to read, but others may appreciate the hash keys being pulled out as headers. Does anyone object to me breaking this? Are there any problems that I haven't thought of? (There usually are). Cheers, In reply to Breaking Test::Differences by Ovid
|
|