# 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;
my $compass = uc( opposite_direction( line_to_canvas_direction(
@{ $coords[0] }, @{ $coords[1] } ) ) );
- # do not weld to a one-line block because the function could get separated
- # from its opening paren
+ # OLD: do not weld to a one-line block because the function could
+ # get separated from its opening paren.
+ # NEW: (30-jan-2021): keep one-line block together for stability
$_[0]->code_handler
( sub { $morexxxxxxxxxxxxxxxxxx .= $_[1] . ":" . $_[0] . "\n" } );
Perl_ErrorNo
Perl_GetVars
PL_sys_intern
- )
+ )
]
);
}
expect => <<'#12...........',
if ( $PLATFORM eq 'aix' ) {
skip_symbols( [ qw(
- Perl_dump_fds
- Perl_ErrorNo
- Perl_GetVars
- PL_sys_intern
- ) ] );
+ Perl_dump_fds
+ Perl_ErrorNo
+ Perl_GetVars
+ PL_sys_intern
+ ) ] );
}
#12...........
},
PPI::Normal
PPI::Util
PPI::Cache
- }
+ }
);
#17...........
},
expect => <<'#18...........',
# qw weld with -wn
use_all_ok( qw{
- PPI
- PPI::Tokenizer
- PPI::Lexer
- PPI::Dumper
- PPI::Find
- PPI::Normal
- PPI::Util
- PPI::Cache
- } );
+ PPI
+ PPI::Tokenizer
+ PPI::Lexer
+ PPI::Dumper
+ PPI::Find
+ PPI::Normal
+ PPI::Util
+ PPI::Cache
+} );
#18...........
},
)
);
- # do not weld to a one-line block because the function could get separated
- # from its opening paren
+ # OLD: do not weld to a one-line block because the function could
+ # get separated from its opening paren.
+ # NEW: (30-jan-2021): keep one-line block together for stability
$_[0]->code_handler(
sub { $morexxxxxxxxxxxxxxxxxx .= $_[1] . ":" . $_[0] . "\n" } );
@{ $coords[0] }, @{ $coords[1] }
) ) );
- # do not weld to a one-line block because the function could get separated
- # from its opening paren
+ # OLD: do not weld to a one-line block because the function could
+ # get separated from its opening paren.
+ # NEW: (30-jan-2021): keep one-line block together for stability
$_[0]->code_handler(
sub { $morexxxxxxxxxxxxxxxxxx .= $_[1] . ":" . $_[0] . "\n" } );
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 "<<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";
+ }
+ }
}
}