Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
3a37c595
Commit
3a37c595
authored
Sep 02, 2004
by
jouni%heikniemi.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 257111: t/006spellcheck.t should check each file only once.
Patch by Marc Schumann <marcschum@web.de> r=jouni, a=myk
parent
fcd317ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
20 deletions
+17
-20
006spellcheck.t
t/006spellcheck.t
+17
-20
No files found.
t/006spellcheck.t
View file @
3a37c595
...
...
@@ -37,7 +37,7 @@ existance
existant
)
;
$testcount
=
scalar
(
@
Support::Files::
testitems
)
*
scalar
(
@evilwords
)
;
$testcount
=
scalar
(
@
Support::Files::
testitems
);
}
use
Test::
More
tests
=>
$testcount
;
...
...
@@ -59,35 +59,32 @@ my $fh;
my
@testitems
=
@
Support::Files::
testitems
;
# at last, here we actually run the test...
my
$evilwordsregexp
=
join
(
'|'
,
@evilwords
);
foreach
my
$file
(
@testitems
)
{
$file
=~
s/\s.*$//
;
# nuke everything after the first space (#comment)
next
if
(
!
$file
);
# skip null entries
foreach
my
$word
(
@evilwords
)
{
# go through the evilwords
if
(
open
(
FILE
,
$file
))
{
# open the file for reading
my
$found_word
=
0
;
if
(
open
(
FILE
,
$file
))
{
# open the file for reading
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
;
}
my
$found_word
=
''
;
while
(
my
$file_line
=
<
FILE
>
)
{
# and go through the file line by line
if
(
$file_line
=~
/($evilwordsregexp)/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
);
close
(
FILE
);
}
else
{
ok
(
0
,
"could not open $file for spellcheck --WARNING
"
);
if
(
$found_word
)
{
ok
(
0
,
"$file: found SPELLING ERROR $found_word --WARNING"
);
}
else
{
ok
(
1
,
"$file does not contain registered spelling errors
"
);
}
}
else
{
ok
(
0
,
"could not open $file for spellcheck --WARNING"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment