diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_api.py | 6 | ||||
-rw-r--r-- | tests/test_files.py | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/test_api.py b/tests/test_api.py index c1e9294..31bfc57 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -221,7 +221,7 @@ class ApiTest(CoverageTest): self.assertEqual(cov.get_exclude_list(), ["foo"]) cov.exclude("bar") self.assertEqual(cov.get_exclude_list(), ["foo", "bar"]) - self.assertEqual(cov._exclude_regex('exclude'), "(foo)|(bar)") + self.assertEqual(cov._exclude_regex('exclude'), "(?:foo)|(?:bar)") cov.clear_exclude() self.assertEqual(cov.get_exclude_list(), []) @@ -233,7 +233,9 @@ class ApiTest(CoverageTest): self.assertEqual(cov.get_exclude_list(which='partial'), ["foo"]) cov.exclude("bar", which='partial') self.assertEqual(cov.get_exclude_list(which='partial'), ["foo", "bar"]) - self.assertEqual(cov._exclude_regex(which='partial'), "(foo)|(bar)") + self.assertEqual( + cov._exclude_regex(which='partial'), "(?:foo)|(?:bar)" + ) cov.clear_exclude(which='partial') self.assertEqual(cov.get_exclude_list(which='partial'), []) diff --git a/tests/test_files.py b/tests/test_files.py index 991c2b1..ea1c494 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -93,6 +93,12 @@ class MatcherTest(CoverageTest): for filepath, matches in matches_to_try: self.assertMatches(fnm, filepath, matches) + def test_fnmatch_matcher_overload(self): + fnm = FnmatchMatcher(["*x%03d*.txt" % i for i in range(500)]) + self.assertMatches(fnm, "x007foo.txt", True) + self.assertMatches(fnm, "x123foo.txt", True) + self.assertMatches(fnm, "x798bar.txt", False) + class PathAliasesTest(CoverageTest): """Tests for coverage/files.py:PathAliases""" |