Skip to content

Commit

Permalink
StringProcessingTest: Improve variable names
Browse files Browse the repository at this point in the history
Use a better loop variable and return-value name in an assert.
  • Loading branch information
Makman2 committed Apr 19, 2015
1 parent 2413544 commit a2f8532
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions coalib/tests/parsing/StringProcessingTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,18 +492,18 @@ def assertSearchForResultEqual(self,
"""
self.assertEqual(len(expected_strings), len(test_strings))
for i in range(0, len(expected_strings)):
return_value = search_for(pattern,
test_strings[i],
flags,
max_match,
use_regex)
matches = search_for(pattern,
test_strings[i],
flags,
max_match,
use_regex)

# Check each MatchObject. Need to iterate over the return_value
# since the return value is an iterator object pointing to the
# MatchObject's.
n = 0
for x in return_value:
self.assertEqual(expected_strings[i][n], x.group(0))
for elem in matches:
self.assertEqual(expected_strings[i][n], elem.group(0))
n += 1

self.assertEqual(n, len(expected_strings[i]))
Expand Down

0 comments on commit a2f8532

Please sign in to comment.