commit 2a1c636156dd0abb61f4da117dd42b6283e877ec Author: Mark Glines Date: Sun Jun 14 18:41:47 2009 -0400 Test is_deeply()'s Undef vs. !exists handling. diff --git a/t/library/test_more.t b/t/library/test_more.t index 396b0b7..ee006ec 100644 --- a/t/library/test_more.t +++ b/t/library/test_more.t @@ -22,7 +22,7 @@ exports = split " ", "plan test_out test_diag test_fail test_pass test_test" test_namespace.'export_to'(curr_namespace, exports) - plan( 75 ) + plan( 76 ) test_skip() test_todo() @@ -326,9 +326,13 @@ .sub test_is_deeply_hash .local pmc left .local pmc right + .local pmc undef1 + .local pmc undef2 - left = new 'Hash' - right = new 'Hash' + left = new 'Hash' + right = new 'Hash' + undef1 = new 'Undef' + undef2 = new 'Undef' test_pass() is_deeply( left, right ) @@ -369,6 +373,13 @@ test_pass() is_deeply( left, right ) test_test( 'passing test is_deeply() for hashes created in different orders' ) + + right['undef1'] = undef1 + left['undef2'] = undef2 + test_fail() + is_deeply( left, right ) + test_diag( 'Mismatch at [undef2]: expected Undef, received nonexistent' ) + test_test( 'failing is_deeply() for undef in left, nonexistent in right' ) .end .sub test_is_deeply_mismatch