Skip to content

Commit

Permalink
parsing: Add auto-trim feature test
Browse files Browse the repository at this point in the history
For function escaped_search_in_between().
  • Loading branch information
Makman2 committed Mar 3, 2015
1 parent 2942293 commit 26f5333
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions coalib/tests/parsing/StringProcessingTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,28 @@ def test_escaped_search_in_between_regex_pattern(self):
self.multi_pattern_test_string)
self.assertEqual(expected_results[i], return_value)

# Test the escaped_search_in_between() function for its
# remove_empty_matches feature.
def test_escaped_search_in_between_auto_trim(self):
begin_sequence = ";"
end_sequence = ";"
expected_results = [
[],
[r"\\\\\;\\#", r"+ios"],
[r"2", r"4", r"6"],
[r"2", r"4", r"6"]
]

for i in range(0, len(expected_results)):
# Execute function under test.
return_value = escaped_search_in_between(
begin_sequence,
end_sequence,
self.auto_trim_test_strings[i],
0,
True)
self.assertEqual(expected_results[i], return_value)

# Test the search_for() function.
def test_search_for(self):
# Match either "out1" or "out2".
Expand Down

0 comments on commit 26f5333

Please sign in to comment.