From c818b43e3e16df67feb73d3e0b751f096c6e5cf0 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 22 Aug 2011 07:42:17 -0400 Subject: PathAliases munges the fnmatch pattern, and could have accidentally borked the match. --- test/test_files.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/test_files.py') diff --git a/test/test_files.py b/test/test_files.py index 2f26c7b..565bbaa 100644 --- a/test/test_files.py +++ b/test/test_files.py @@ -120,6 +120,13 @@ class PathAliasesTest(CoverageTest): aliases.add, "/ned/home/*/*/", "fooey" ) + def test_no_accidental_munging(self): + aliases = PathAliases() + aliases.add(r'c:\Zoo\boo', 'src/') + aliases.add('/home/ned$', 'src/') + self.assertEqual(aliases.map(r'c:\Zoo\boo\foo.py'), 'src/foo.py') + self.assertEqual(aliases.map(r'/home/ned$/foo.py'), 'src/foo.py') + def test_paths_are_os_corrected(self): aliases = PathAliases() aliases.add('/home/ned/*/src', './mysrc') -- cgit v1.2.1