commit 2a1c636156dd0abb61f4da117dd42b6283e877ec
Author: Mark Glines <mark@glines.org>
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
|
b
|
|
22 | 22 | exports = split " ", "plan test_out test_diag test_fail test_pass test_test" |
23 | 23 | test_namespace.'export_to'(curr_namespace, exports) |
24 | 24 | |
25 | | plan( 75 ) |
| 25 | plan( 76 ) |
26 | 26 | |
27 | 27 | test_skip() |
28 | 28 | test_todo() |
… |
… |
|
326 | 326 | .sub test_is_deeply_hash |
327 | 327 | .local pmc left |
328 | 328 | .local pmc right |
| 329 | .local pmc undef1 |
| 330 | .local pmc undef2 |
329 | 331 | |
330 | | left = new 'Hash' |
331 | | right = new 'Hash' |
| 332 | left = new 'Hash' |
| 333 | right = new 'Hash' |
| 334 | undef1 = new 'Undef' |
| 335 | undef2 = new 'Undef' |
332 | 336 | |
333 | 337 | test_pass() |
334 | 338 | is_deeply( left, right ) |
… |
… |
|
369 | 373 | test_pass() |
370 | 374 | is_deeply( left, right ) |
371 | 375 | test_test( 'passing test is_deeply() for hashes created in different orders' ) |
| 376 | |
| 377 | right['undef1'] = undef1 |
| 378 | left['undef2'] = undef2 |
| 379 | test_fail() |
| 380 | is_deeply( left, right ) |
| 381 | test_diag( 'Mismatch at [undef2]: expected Undef, received nonexistent' ) |
| 382 | test_test( 'failing is_deeply() for undef in left, nonexistent in right' ) |
372 | 383 | .end |
373 | 384 | |
374 | 385 | .sub test_is_deeply_mismatch |