Mercurial > public > mercurial-scm > hg-stable
diff tests/test-match.py @ 42368:38d85ec06552
match: drop unnecessary adding of '' to set of dirs
This breaks some tests for "rootfilesin:" in a pattern matcher even
more, but that just shows how broken that case is.
Differential Revision: https://phab.mercurial-scm.org/D6406
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 24 Apr 2019 09:39:40 -0700 |
parents | 27d6956d386b |
children | 2372284d9457 |
line wrap: on
line diff
--- a/tests/test-match.py Mon Apr 22 22:43:00 2019 -0700 +++ b/tests/test-match.py Wed Apr 24 09:39:40 2019 -0700 @@ -84,21 +84,21 @@ def testVisitdirRootfilesin(self): m = matchmod.match(b'x', b'', patterns=[b'rootfilesin:dir/subdir']) assert isinstance(m, matchmod.patternmatcher) - self.assertTrue(m.visitdir(b'')) self.assertFalse(m.visitdir(b'dir/subdir/x')) self.assertFalse(m.visitdir(b'folder')) # FIXME: These should probably be True. + self.assertFalse(m.visitdir(b'')) self.assertFalse(m.visitdir(b'dir')) self.assertFalse(m.visitdir(b'dir/subdir')) def testVisitchildrensetRootfilesin(self): m = matchmod.match(b'x', b'', patterns=[b'rootfilesin:dir/subdir']) assert isinstance(m, matchmod.patternmatcher) - self.assertEqual(m.visitchildrenset(b''), b'this') self.assertEqual(m.visitchildrenset(b'dir/subdir/x'), set()) self.assertEqual(m.visitchildrenset(b'folder'), set()) - # FIXME: These should probably be {'subdir'} and 'this', respectively, - # or at least 'this' and 'this'. + # FIXME: These should probably be {'dir'}, {'subdir'} and 'this', + # respectively, or at least 'this' for all three. + self.assertEqual(m.visitchildrenset(b''), set()) self.assertEqual(m.visitchildrenset(b'dir'), set()) self.assertEqual(m.visitchildrenset(b'dir/subdir'), set())