title: Test::More is_deeply does not pretty-print array/hashrefs when comparing against strings
body: <p>When Test::More compares like arrayrefs and hashrefs with each other, the corresponding diagnostic message is really informative and shows the first index where the structures differ, regardless of nesting depth. However, when it is comparing an arrayref or hashref to a simple scalar, it produces a stringified scalar (with a memory address and reference type) in the diagnostic message, which is harder to interpret. </p>
  
  <p>Is there a way to configure Test::More to pretty-print array or hashrefs in a custom way (such as using Data::Dumper)?</p>
  
  <p>Here's an example with two test cases. The first gives you some insight into what is present in your program but unexpected. The second informs the user of a type mismatch between the string and the arrayref, but does not print any items in the arrayref.</p>
  
  <pre><code>#!/usr/bin/env perl
  use strict;
  use warnings;
  use Test::More tests =&gt; 2;
  
  is_deeply(
      {
          a =&gt; [5],
      },
      {
          a =&gt; [5, 6, 8],
      },
      'compare two hashrefs structurally (very informative output)',
  );
  
  is_deeply(
      [5, 6, 8],
      "",
      'compare two "incompatible" values structurally (uninformative output)',
  );
  </code></pre>
  
  <p>And the TAP output:</p>
  
  <pre><code>1..2
  not ok 1 - compare two hashrefs structurally (very informative output)
  #   Failed test 'compare two hashrefs structurally (very informative output)'
  #   at test-more-failure.pl line 6.
  #     Structures begin differing at:
  #          $got-&gt;{a}[1] = Does not exist
  #     $expected-&gt;{a}[1] = '6'
  not ok 2 - compare two "incompatible" values structurally (uninformative output)
  #   Failed test 'compare two "incompatible" values structurally (uninformative output)'
  #   at test-more-failure.pl line 16.
  #     Structures begin differing at:
  #          $got = ARRAY(0x7fe66b82cde8)
  #     $expected = ''
  # Looks like you failed 2 tests of 2.
  </code></pre>
  
  <p>Looking at the implementation of <code>is_deeply</code> in Test::More, there doesn't seem to be way to use a custom pretty-printer or configure the verbosity of the module. At least none that's obvious to me.</p>
  
  <p>Here is what happens when we compare a reference and non-reference:</p>
  
  <p><a href="https://metacpan.org/source/EXODIST/Test-Simple-1.302062/lib/Test/More.pm#L1121" rel="noreferrer">https://metacpan.org/source/EXODIST/Test-Simple-1.302062/lib/Test/More.pm#L1121</a></p>
  
  <p>It seems to be calling <code>_format_stack({vals =&gt; [...]})</code> instead of <code>_format_stack(...)</code></p>
  
  <p><a href="https://metacpan.org/source/EXODIST/Test-Simple-1.302062/lib/Test/More.pm#L1139" rel="noreferrer">https://metacpan.org/source/EXODIST/Test-Simple-1.302062/lib/Test/More.pm#L1139</a></p>