diff options
author | zach%zachlipton.com <> | 2003-01-11 08:51:29 +0100 |
---|---|---|
committer | zach%zachlipton.com <> | 2003-01-11 08:51:29 +0100 |
commit | 52b2954e7fd06d732b6c25337fb9e3d36e8fbf56 (patch) | |
tree | e941fddf8a7c4eebc1906cb12cb87353819f8a41 /t | |
parent | d0932ae81be706564a0e0afb5221ba73157e6efa (diff) | |
download | bugzilla-52b2954e7fd06d732b6c25337fb9e3d36e8fbf56.tar.gz bugzilla-52b2954e7fd06d732b6c25337fb9e3d36e8fbf56.tar.xz |
Fix for bug 166481 ("Spellcheck is borked"). Part one of this fix fixes
the spelling errors so tinderbox doesn't barf, part two fixes
t/006spellcheck.t and adds some more new words to check for.
Part 1 patch by myself, r=timeless
Part 2 patch by MattyT. r=zach (myself)
a=justdave
Diffstat (limited to 't')
-rw-r--r-- | t/006spellcheck.t | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/t/006spellcheck.t b/t/006spellcheck.t index b28c28ad5..29196cf1f 100644 --- a/t/006spellcheck.t +++ b/t/006spellcheck.t @@ -32,6 +32,9 @@ BEGIN { # yes the indenting is off, deal with it @evilwords = qw( databasa arbitary +paramater +existance +existant ); $testcount = scalar(@Support::Files::testitems) * scalar(@evilwords); @@ -60,21 +63,32 @@ my @testitems = @Support::Files::testitems; foreach my $file (@testitems) { $file =~ s/\s.*$//; # nuke everything after the first space (#comment) next if (!$file); # skip null entries - if (! open (FILE, $file)) { # open the file for reading - ok(0,"could not open $file for spellcheck --WARNING"); - next; + + foreach my $word (@evilwords) { # go through the evilwords + + if (open (FILE, $file)) { # open the file for reading + my $found_word = 0; + + while (my $file_line = <FILE>) { # and go through the file line by line + if ($file_line =~ /$word/i) { # found an evil word + $found_word = 1; + last; + } + } + + if ($found_word) { + ok(0,"$file: found SPELLING ERROR $word --WARNING"); + } + else { + ok(1,"$file does not contain the spelling error $word"); + } + + close (FILE); + } + else { + ok(0,"could not open $file for spellcheck --WARNING"); + } } - foreach my $word (@evilwords) { # go through the evilwords - while (my $file_line = <FILE>) { # and go through the file line by line - if ($file_line =~ /$word/i) { # found an evil word - $found_word = 1; - last; - } - } - if ($found_word eq 1) { ok(0,"$file: found SPELLING ERROR $word --WARNING") } - if ($found_word ne 1) { ok(1,"$file does not contain the spelling error $word") } - $found_word = 0; - } } exit 0; |