diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2014-09-21 11:32:43 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2014-09-21 11:32:43 -0400 |
commit | 134b27ee390d5bb5c524e2fd6a1902eb2002ae2a (patch) | |
tree | 3e8caaca2ec4f432ea5d10205a2f220b0caf7d06 /tests/test_files.py | |
parent | f491f4f37ff2e18090b1f8c74d20a95591f4fc81 (diff) | |
download | python-coveragepy-git-134b27ee390d5bb5c524e2fd6a1902eb2002ae2a.tar.gz |
Make the Fnmatcher work right on Windows.
Diffstat (limited to 'tests/test_files.py')
-rw-r--r-- | tests/test_files.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_files.py b/tests/test_files.py index 070430ff..648c76a9 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -99,6 +99,14 @@ class MatcherTest(CoverageTest): self.assertMatches(fnm, "x123foo.txt", True) self.assertMatches(fnm, "x798bar.txt", False) + def test_fnmatch_windows_paths(self): + # We should be able to match Windows paths even if we are running on + # a non-Windows OS. + fnm = FnmatchMatcher(["*/foo.py"]) + self.assertMatches(fnm, r"dir\foo.py", True) + fnm = FnmatchMatcher([r"*\foo.py"]) + self.assertMatches(fnm, r"dir\foo.py", True) + class PathAliasesTest(CoverageTest): """Tests for coverage/files.py:PathAliases""" |