Improve error diagnostics in t/test_pl/tempfile.t
authorBrad Gilbert <b2gills@gmail.com>
Tue, 4 Feb 2014 16:20:26 +0000 (10:20 -0600)
committerTony Cook <tony@develop-help.com>
Thu, 13 Feb 2014 02:53:28 +0000 (13:53 +1100)
Tony: add a missing local

t/test_pl/tempfile.t

index 51937c4..dba363e 100644 (file)
@@ -22,16 +22,20 @@ sub skip_files{
         }
     }
 
+    local $main::Level = $main::Level + 1;
+
     my $common_mess = "skip $skip filenames to $to so that the next one will end with $next";
     if( $last == $skip ){
         if( $check eq $cmp ){
             pass( $common_mess );
         }else{
             my($alpha) = $check =~ /\Atmp\d+([A-Z][A-Z]?)\Z/;
-            fail( $common_mess, "only skipped to $alpha" )
+            fail( $common_mess );
+            diag( "only skipped to $alpha" );
         }
     }else{
-        fail( $common_mess, "only skipped $last files" );
+        fail( $common_mess );
+        diag( "only skipped $last out of $skip files" );
     }
 }