summaryrefslogtreecommitdiff
path: root/tests/test_files.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2014-09-21 11:32:43 -0400
committerNed Batchelder <ned@nedbatchelder.com>2014-09-21 11:32:43 -0400
commita4c441bd2a112d9f5832e212040d7ed533837f9c (patch)
treee647031aa788ad750e9557a84e49efe53e278280 /tests/test_files.py
parentdd83d87cecb28ef014be663829f9d5849086ab85 (diff)
downloadpython-coveragepy-a4c441bd2a112d9f5832e212040d7ed533837f9c.tar.gz
Make the Fnmatcher work right on Windows.
Diffstat (limited to 'tests/test_files.py')
-rw-r--r--tests/test_files.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_files.py b/tests/test_files.py
index 070430f..648c76a 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"""