]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 135543 - @Support::Templates::testitems does not list all templates
authorbbaetz%student.usyd.edu.au <>
Sun, 1 Mar 2009 04:03:11 +0000 (04:03 +0000)
committerbbaetz%student.usyd.edu.au <>
Sun, 1 Mar 2009 04:03:11 +0000 (04:03 +0000)
Patch by ddkilzer@theracingworld.com (David D. Kilzer), r=gerv, justdave

t/005whitespace.t

index a3c9fed3aeb71bfeb10ac95279b8dff95f1d9c89..eaf1ef241fd77ca0a81f3a1ac1452677be866196 100644 (file)
 # Rights Reserved.
 #
 # Contributor(s): Jacob Steenhagen <jake@acutex.net>
+#                 David D. Kilzer <ddkilzer@kilzer.net>
 #
 
 #################
 #Bugzilla Test 5#
 #####no_tabs#####
 
-BEGIN { use lib "t/"; }
-BEGIN { use Support::Files; }
-BEGIN { use Support::Templates; }
-BEGIN { $tests = @Support::Files::testitems; }
-BEGIN { $tests += @Support::Templates::testitems; }
-BEGIN { use Test::More tests => $tests; }
-
+use diagnostics;
 use strict;
 
+use lib 't';
+
+use Support::Files;
+use Support::Templates;
+
+use File::Spec 0.82;
+use Test::More tests => (  scalar(@Support::Files::testitems)
+                         + scalar(@Support::Templates::actual_files));
+
 my @testitems = @Support::Files::testitems;
-my @templates = map($Support::Templates::include_path . "/" . $_,
-                    @Support::Templates::testitems);
+my @templates = map(File::Spec->catfile($Support::Templates::include_path, $_),
+                    @Support::Templates::actual_files);
 push(@testitems, @templates);
 
 foreach my $file (@testitems) {
     open (FILE, "$file");
-    my @file = <FILE>;
-    close (FILE);
-    if (grep /\t/, @file) {
+    if (grep /\t/, <FILE>) {
         ok(0, "$file contains tabs --WARNING");
     } else {
         ok(1, "$file has no tabs");
     }
+    close (FILE);
 }