From ed4af4249961a69449820e27b0baaf5116142b9e Mon Sep 17 00:00:00 2001 From: "jake%acutex.net" <> Date: Sat, 20 Oct 2001 05:39:46 +0000 Subject: 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 Additional edits by myself to add the emacs mode line. Also, the change to runtests.sh was done by me. --- t/002goodperl.t | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) (limited to 't/002goodperl.t') 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"); + } } -- cgit v1.2.3-24-g4f1b