X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=t%2Fsnippets6.t;h=fad6a897058e4dc030a8fe4cc19194bd246acb19;hb=57d829ae0e2c75828f8ecc9c7139579350927dbc;hp=4836fffc4d04bf248851b88cdd13cfe53735d427;hpb=7f27e55dce5925b2bbe8fcfca64f385e917a52be;p=perltidy.git diff --git a/t/snippets6.t b/t/snippets6.t index 4836fff..fad6a89 100644 --- a/t/snippets6.t +++ b/t/snippets6.t @@ -25,7 +25,7 @@ # To locate test #13 you can search for its name or the string '#13' use strict; -use Test; +use Test::More; use Carp; use Perl::Tidy; my $rparams; @@ -171,9 +171,9 @@ state $b //= ccc(); return $pdl->slice( join ',', ( map { - $_ eq "X" ? ":" + $_ eq "X" ? ":" : ref $_ eq "ARRAY" ? join ':', @$_ - : !ref $_ ? $_ + : !ref $_ ? $_ : die "INVALID SLICE DEF $_" } @_ ) @@ -430,32 +430,39 @@ foreach my $key ( sort keys %{$rtests} ) { perltidyrc => \$params, argv => '', # for safety; hide any ARGV from perltidy stderr => \$stderr_string, - errorfile => \$errorfile_string, # not used when -se flag is set + errorfile => \$errorfile_string, # not used when -se flag is set ); if ( $err || $stderr_string || $errorfile_string ) { + print STDERR "Error output received for test '$key'\n"; if ($err) { - print STDERR -"This error received calling Perl::Tidy with '$sname' + '$pname'\n"; + print STDERR "An error flag '$err' was returned\n"; ok( !$err ); } if ($stderr_string) { print STDERR "---------------------\n"; print STDERR "<>\n$stderr_string\n"; print STDERR "---------------------\n"; - print STDERR -"This error received calling Perl::Tidy with '$sname' + '$pname'\n"; ok( !$stderr_string ); } if ($errorfile_string) { print STDERR "---------------------\n"; print STDERR "<<.ERR file>>\n$errorfile_string\n"; print STDERR "---------------------\n"; - print STDERR -"This error received calling Perl::Tidy with '$sname' + '$pname'\n"; ok( !$errorfile_string ); } } else { - ok( $output, $expect ); + if ( !is( $output, $expect, $key ) ) { + my $leno = length($output); + my $lene = length($expect); + if ( $leno == $lene ) { + print STDERR +"#> Test '$key' gave unexpected output. Strings differ but both have length $leno\n"; + } + else { + print STDERR +"#> Test '$key' gave unexpected output. String lengths differ: output=$leno, expected=$lene\n"; + } + } } }