[tapx-dev] [commit][275] Croak on empty test script

andy at hexten.net andy at hexten.net
Sun Aug 19 12:09:13 BST 2007


Revision: 275
Author:   andy
Date:     2007-08-19 12:09:12 +0100 (Sun, 19 Aug 2007)

Log Message:
-----------
Croak on empty test script

Modified Paths:
--------------
    trunk/Changes
    trunk/lib/TAP/Parser/Source/Perl.pm

Modified: trunk/Changes
===================================================================
--- trunk/Changes	2007-08-19 11:06:53 UTC (rev 274)
+++ trunk/Changes	2007-08-19 11:09:12 UTC (rev 275)
@@ -1,6 +1,9 @@
 Revision history for TAP-Parser
 
-0.53
+0.54
+    - Croak if supplied an empty (0 lines) Perl script.
+
+0.53  18 August 2007
     - Fixed a few docs nits.
     - Added -V (--version) switch to runtests.  Suggested by markjugg on
       Perlmonks.

Modified: trunk/lib/TAP/Parser/Source/Perl.pm
===================================================================
--- trunk/lib/TAP/Parser/Source/Perl.pm	2007-08-19 11:06:53 UTC (rev 274)
+++ trunk/lib/TAP/Parser/Source/Perl.pm	2007-08-19 11:09:12 UTC (rev 275)
@@ -178,6 +178,8 @@
     my $shebang = <TEST>;
     close(TEST) or print "can't close $file. $!\n";
 
+    $self->_croak("Script $file is empty") unless defined $shebang;
+
     my $taint = ( $shebang =~ /^#!.*\bperl.*\s-\w*([Tt]+)/ );
     push( @switches, "-$1" ) if $taint;
 




More information about the tapx-dev mailing list