summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzach%zachlipton.com <>2003-01-11 08:51:29 +0100
committerzach%zachlipton.com <>2003-01-11 08:51:29 +0100
commit52b2954e7fd06d732b6c25337fb9e3d36e8fbf56 (patch)
treee941fddf8a7c4eebc1906cb12cb87353819f8a41
parentd0932ae81be706564a0e0afb5221ba73157e6efa (diff)
downloadbugzilla-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
-rw-r--r--Bugzilla/CGI.pm2
-rw-r--r--defparams.pl4
-rwxr-xr-xeditgroups.cgi4
-rw-r--r--t/006spellcheck.t42
4 files changed, 33 insertions, 19 deletions
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm
index ad609c2ab..3c00ed347 100644
--- a/Bugzilla/CGI.pm
+++ b/Bugzilla/CGI.pm
@@ -146,7 +146,7 @@ I<Bugzilla::CGI> also includes additional functions.
=item C<canonicalise_query(@exclude)>
-This returns a sorted string of the paramaters, suitable for use in a url.
+This returns a sorted string of the parameters, suitable for use in a url.
Values in C<@exclude> are not included in the result.
=back
diff --git a/defparams.pl b/defparams.pl
index 1d6712a6a..0d6c2a3c7 100644
--- a/defparams.pl
+++ b/defparams.pl
@@ -72,7 +72,7 @@ sub check_shadowdb {
return "You need to specify a host when using a shadow database";
}
- # Can't test existance of this because ConnectToDatabase uses the param,
+ # Can't test existence of this because ConnectToDatabase uses the param,
# but we can't set this before testing....
# This can really only be fixed after we can use the DBI more openly
return "";
@@ -294,7 +294,7 @@ sub check_netmask {
'This is done so that long slow read-only operations can be used ' .
'against this db, and not lock up things for everyone else. This ' .
'database is on the <tt>shadowdbhost</tt>, and must exist. ' .
- 'Bugzilla does not update it, if you use this paramater, then ' .
+ 'Bugzilla does not update it, if you use this parameter, then ' .
'you need to set up replication for your database',
type => 't',
default => '',
diff --git a/editgroups.cgi b/editgroups.cgi
index a9af65bc6..1b793c6d3 100755
--- a/editgroups.cgi
+++ b/editgroups.cgi
@@ -231,9 +231,9 @@ if ($action eq 'changeform') {
print "<TR><TD ALIGN=CENTER>|</TD><TD COLSPAN=3>Members of these groups are included in this group</TD></TR>";
print "<TR><TD ALIGN=CENTER>|</TD><TD ALIGN=CENTER>|</TD><TD COLSPAN=2></TD><TR>";
- # For each group, we use left joins to establish the existance of
+ # For each group, we use left joins to establish the existence of
# a record making that group a member of this group
- # and the existance of a record permitting that group to bless
+ # and the existence of a record permitting that group to bless
# this one
SendSQL("SELECT groups.id, groups.name, groups.description," .
" group_group_map.member_id IS NOT NULL," .
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;