diff options
author | jake%acutex.net <> | 2001-10-20 07:39:46 +0200 |
---|---|---|
committer | jake%acutex.net <> | 2001-10-20 07:39:46 +0200 |
commit | ed4af4249961a69449820e27b0baaf5116142b9e (patch) | |
tree | 09425865e2c77171faec1a1a66d2210b7dc6fdf7 /t/002goodperl.t | |
parent | b929c22527a9f97d4e03937d255542dfb5384f02 (diff) | |
download | bugzilla-ed4af4249961a69449820e27b0baaf5116142b9e.tar.gz bugzilla-ed4af4249961a69449820e27b0baaf5116142b9e.tar.xz |
Bug 103664 - Tests should "use strict;" and not contain any tabs. We should also use the TEST_VERBOSE environment variable instead of VERBOSE.
Patch by David D. Kilzer <ddkilzer@theracingworld.com>
Additional edits by myself to add the emacs mode line. Also, the change to runtests.sh was done by me.
Diffstat (limited to 't/002goodperl.t')
-rw-r--r-- | t/002goodperl.t | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/t/002goodperl.t b/t/002goodperl.t index 8efa8367a..3615d489a 100644 --- a/t/002goodperl.t +++ b/t/002goodperl.t @@ -1,3 +1,4 @@ +# -*- Mode: perl; indent-tabs-mode: nil -*- # # The contents of this file are subject to the Mozilla Public # License Version 1.1 (the "License"); you may not use this file @@ -40,34 +41,37 @@ BEGIN { use Support::Files; } BEGIN { $tests = @Support::Files::testitems * 2; } BEGIN { use Test::More tests => $tests; } -@testitems = @Support::Files::testitems; # get the files to test. +use strict; -foreach $file (@testitems) { +my @testitems = @Support::Files::testitems; # get the files to test. +my $verbose = $::ENV{TEST_VERBOSE}; + +foreach my $file (@testitems) { $file =~ s/\s.*$//; # nuke everything after the first space (#comment) next if (!$file); # skip null entries - $filecontent = `cat $file`; - if ($filecontent !~ /\/usr\/bonsaitools\/bin\/perl/) { - ok(1,"$file does not have a shebang"); - next; - } else { - if ($filecontent =~ m#/usr/bonsaitools/bin/perl -w#) { - ok(1,"$file uses -w"); - next; - } else { - ok(0,"$file is MISSING -w"); - next; - } - } + my $filecontent = `cat $file`; + if ($filecontent !~ /\/usr\/bonsaitools\/bin\/perl/) { + ok(1,"$file does not have a shebang"); + next; + } else { + if ($filecontent =~ m#/usr/bonsaitools/bin/perl -w#) { + ok(1,"$file uses -w"); + next; + } else { + ok(0,"$file is MISSING -w"); + next; + } + } } -foreach $file (@testitems) { - $file =~ s/\s.*$//; # nuke everything after the first space (#comment) - next if (!$file); # skip null entries - $filecontent = `cat $file`; - if ($filecontent !~ /use strict/) { - ok(0,"$file DOES NOT use strict"); - } else { - ok(1,"$file uses strict"); - } +foreach my $file (@testitems) { + $file =~ s/\s.*$//; # nuke everything after the first space (#comment) + next if (!$file); # skip null entries + my $filecontent = `cat $file`; + if ($filecontent !~ /use strict/) { + ok(0,"$file DOES NOT use strict"); + } else { + ok(1,"$file uses strict"); + } } |