Revision history for Test-EOL
+ - Fix misleading test failure diagnostics when only issue are
+ trailing whitespaces
+
0.9 2010-06-16
- - Fix warnings on very old perls (paul@city-fan.org)
- (Closes: RT#58442)
+ - Fix warnings on very old perls (paul@city-fan.org)
+ (Closes: RT#58442)
0.8 2010-06-11
- Use binmode :raw for input/output. Solves win32 translating the
sub _debug_line {
my ( $options, $line ) = @_;
$line->[2] =~ s/\n\z//g;
- return "line $line->[1] : $line->[0] " . (
+ return "line $line->[1]: $line->[0] " . (
$options->{show_lines} ? qq{: } . _show_whitespace( $line->[2] ) : q{}
);
}
my $file = shift;
my $test_txt;
$test_txt = shift if !ref $_[0];
- $test_txt ||= "No windows line endings in '$file'";
+ $test_txt ||= "No incorrect line endings in '$file'";
my $options = shift if ref $_[0] eq 'HASH';
$options ||= {
trailing_whitespace => 0,
local $/ = undef;
open my $fh, '<', $outfile or die $!;
my $content = <$fh>;
- like( $content, qr/^not ok 1 - No windows line endings in '[^']*' on line 4/m, 'windows EOL found in tmp file 1' );
+ like( $content, qr/^not ok 1 - No incorrect line endings in '[^']*' \Qon line 4: [\r]/m, 'windows EOL found in tmp file 1' );
unlink $outfile;
}
{
open my $fh, '<', $outfile or die $!;
local $/ = undef;
my $content = <$fh>;
- like( $content, qr/^not ok 1 - No windows line endings in '[^']*' on line \d+/m, 'windows EOL found in tmp file2 ' );
+ like( $content, qr/^not ok 1 - No incorrect line endings in '[^']*' \Qon line 8: [\r][\r][\r][\r][\r][\r][\r]/m, 'windows EOL found in tmp file2 ' );
unlink $outfile;
}
{
open my $fh, '<', $outfile or die $!;
local $/ = undef;
my $content = <$fh>;
- like( $content, qr/^not ok 1 - No windows line endings in '[^']*' on line \d+/m, 'windows EOL found in tmp file 3' );
+ like( $content, qr/^not ok 1 - No incorrect line endings in '[^']*' \Qon line 9: [\r][\r][\r]/m, 'windows EOL found in tmp file 3' );
unlink $outfile;
}
open my $fh, '<', $outfile or die $!;
local $/ = undef;
my $content = <$fh>;
- like( $content, qr/^not ok 1 - No windows line endings in '[^']*' on line \d+/m, 'windows EOL found in tmp file 4' );
+ like( $content, qr/^not ok 1 - No incorrect line endings in '[^']*' \Qon line 13: [\s][\t][\s][\s]/m, 'Trailing ws EOL found in tmp file 4' );
unlink $outfile;
}
sub main {
DUMMY
-print $fh qq{ print "Hello!\n"; \n}; # <-- whitespace
+print $fh qq{ print "Hello!\n"; \t \n}; # <-- whitespace
print $fh '}';
return $tmpdir;