summaryrefslogtreecommitdiff
path: root/tests/test_files.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_files.py')
-rw-r--r--tests/test_files.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test_files.py b/tests/test_files.py
index b658853a..813f8612 100644
--- a/tests/test_files.py
+++ b/tests/test_files.py
@@ -9,7 +9,7 @@ import os.path
from coverage import files
from coverage.files import (
TreeMatcher, FnmatchMatcher, ModuleMatcher, PathAliases,
- find_python_files, abs_file, actual_path
+ find_python_files, abs_file, actual_path, flat_rootname,
)
from coverage.misc import CoverageException
from coverage import env
@@ -54,6 +54,10 @@ class FilesTest(CoverageTest):
rel = os.path.join('sub', trick, 'file1.py')
self.assertEqual(files.relative_filename(abs_file(rel)), rel)
+ def test_flat_rootname(self):
+ self.assertEqual(flat_rootname("a/b/c.py"), "a_b_c_py")
+ self.assertEqual(flat_rootname(r"c:\foo\bar.html"), "c__foo_bar_html")
+
class MatcherTest(CoverageTest):
"""Tests of file matchers."""