use strict; use warnings; use Test::Tester; use Test::More 0.96; subtest "two identical structures" => sub { my (undef, $result1) = run_tests sub { is_deeply( [1,2,3], [1..3] ) }; ok( $result1->{ok}, 'is_deeply passes', ); is( $result1->{diag}, '', 'no unnecessary diagnostics printed', ); done_testing; }; subtest "two different structures" => sub { my (undef, $result2) = run_tests sub { is_deeply( [1,3], [1..3] ) }; ok( !$result2->{ok}, 'is_deeply fails' ); like( $result2->{diag}, qr{Structures begin differing}, 'expected diagnostics ok' ); done_testing; }; done_testing;