From fb75be7e173fe1e42d24ee6343ccce96261920ac Mon Sep 17 00:00:00 2001 From: Hugo van der Sanden Date: Mon, 29 Oct 2012 23:31:21 +0000 Subject: [PATCH] test.pl: allow for undefs in eq_hash It should be possible to compare hashes with undef values without triggering warnings. --- t/test.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/test.pl b/t/test.pl index 0f0caa9..c4e6fd1 100644 --- a/t/test.pl +++ b/t/test.pl @@ -497,7 +497,10 @@ sub eq_hash { # Force a hash recompute if this perl's internals can cache the hash key. $key = "" . $key; if (exists $orig->{$key}) { - if ($orig->{$key} ne $value) { + if ( + defined $orig->{$key} != defined $value + || (defined $value && $orig->{$key} ne $value) + ) { _print "# key ", _qq($key), " was ", _qq($orig->{$key}), " now ", _qq($value), "\n"; $fail = 1; -- 2.7.4