This seems to do the trick :)
use v5.12.0; use warnings; use Data::Dump qw/pp dd/; use Test::More import => ['is_deeply', 'done_testing']; my $test_builder = Test::More->builder; my %out; $test_builder->output(\ $out{std}); $test_builder->failure_output(\ $out{failure}); $test_builder->todo_output(\ $out{todo}); warn "Test pass: " . is_deeply( {a=>1}, {a=>1},"pass?"); warn "Test fail: " . is_deeply( {a=>1}, {b=>1},"fail?"); done_testing; my $div = "-"x10; for my $type (qw/std failure todo/){ my $out = $out{$type} // ""; say <<"__OUT__"; $div $type $div $out $div __OUT__ } pp \%out;

Test pass: 1 at d:/temp/redirect_test_more.pl line 16. Test fail: 0 at d:/temp/redirect_test_more.pl line 17. ---------- std ---------- ok 1 - pass? not ok 2 - fail? 1..2 ---------- ---------- failure ---------- # Failed test 'fail?' # at d:/temp/redirect_test_more.pl line 17. # Structures begin differing at: # $got->{b} = Does not exist # $expected->{b} = '1' ---------- ---------- todo ---------- ---------- { failure => "# Failed test 'fail?'\n# at d:/temp/redirect_test_mo +re.pl line 17.\n# Structures begin differing at:\n# \$go +t->{b} = Does not exist\n# \$expected->{b} = '1'\n", std => "ok 1 - pass?\nnot ok 2 - fail?\n1..2\n", todo => undef, }

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery


In reply to Re: Controlling output and side effects from Test::More (solved) by LanX
in thread Controlling output and side effects from Test::More by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.