Fix misleading diag when looking for trailing whitespace
[catagits/Test-EOL.git] / t / 12-fail.t
index eef773b..0665344 100644 (file)
@@ -23,7 +23,7 @@ $inc = "-I $inc" if $inc;
     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;
 }
 {
@@ -33,7 +33,7 @@ $inc = "-I $inc" if $inc;
     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;
 }
 {
@@ -43,7 +43,7 @@ $inc = "-I $inc" if $inc;
     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;
 }
 
@@ -54,7 +54,7 @@ $inc = "-I $inc" if $inc;
     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;
 }
 
@@ -151,7 +151,7 @@ test.pL -   A test script
 sub main {
 DUMMY
 
-print $fh qq{    print "Hello!\n";   \n}; # <-- whitespace
+print $fh qq{    print "Hello!\n"; \t  \n}; # <-- whitespace
 print $fh '}';
 
   return $tmpdir;