Commits

Ned Batchelder committed 5c88c43

More windows tweaking.

Comments (0)

Files changed (2)

coverage/files.py

         regex_pat = fnmatch.translate(pattern).replace(r'\Z(', '(')
         if regex_pat.endswith("$"):
             regex_pat = regex_pat[:-1]
+        # We want */a/b.py to match on Windows to, so change slash to match
+        # either separator.
+        regex_pat = regex_pat.replace(r"\/", r"[\\/]")
+        # We want case-insensitive matching, so add that flag.
         regex = re.compile("(?i)" + regex_pat)
 
         # Normalize the result: it must end with a path separator.

test/test_process.py

         # files have been combined together.
         data = coverage.CoverageData()
         data.read_file(".coverage")
-        self.assertEqual(data.summary(fullpath=True), {'src/x.py': 6})
+        summary = data.summary(fullpath=True)
+        self.assertEqual(len(summary), 1)
+        self.assertEqual(summary.keys()[0], os.path.normpath('src/x.py'))
+        self.assertEqual(summary.values()[0], 6)
 
     def test_missing_source_file(self):
         # Check what happens if the source is missing when reporting happens.