for (values $href) {
$_ = int !!$_ if JSON::is_bool($_);
}
So that Test::Differences::eq_or_diff doesn't consider the blessed boolean thingies to be different from the 0 and 1 (or \0 and \1) I'm using in the first place.
A setting that downgrades the true and false atoms to simple scalars (perhaps customisable) would be very useful in this situation.
This is rather an issue of how to write your tests, not JSON.pm and its backends. Boolean values should not be downgraded to integers, because you can't tell integer 0/1 from converted boolean 0/1 in general.
In my tests I have to do something like this:
So that Test::Differences::eq_or_diff doesn't consider the blessed boolean thingies to be different from the 0 and 1 (or
\0
and\1
) I'm using in the first place.A setting that downgrades the true and false atoms to simple scalars (perhaps customisable) would be very useful in this situation.