- is_deeply
is_deeply( complex_structure, expected_complex_structure, name);
Compare two Perl data structures:
examples/test-more/t/is_deeply.t
use strict; use warnings; use Test::More tests => 11; use MyTools qw(fibo fibonacci); is fibo(0), 0; is fibo(1), 1; is fibo(2), 1; is fibo(3), 2; is fibo(4), 3; is fibo(5), 5; is_deeply fibonacci(1), [0, 1], 'fibs 1'; is_deeply fibonacci(2), [0, 1, 1], 'fibs 2'; is_deeply fibonacci(3), [0, 1, 1, 2], 'fibs 3'; is_deeply fibonacci(4), [0, 1, 1, 2, 3], 'fibs 4'; is_deeply fibonacci(5), [0, 1, 1, 2, 3, 5], 'fibs 5';
# Failed test 'fibs 4' # at t/is_deeply.t line 20. # Structures begin differing at: # $got->[3] = '4' # $expected->[3] = '2' # Looks like you failed 1 test of 11. t/is_deeply.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/11 subtests Test Summary Report ------------------- t/is_deeply.t (Wstat: 256 Tests: 11 Failed: 1) Failed test: 10 Non-zero exit status: 1 Files=1, Tests=11, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.13 cusr 0.01 csys = 0.15 CPU) Result: FAIL