|
@@
-13,36
+13,36
b' class BaseMatcherTests(unittest.TestCase'
|
|
13
|
|
|
13
|
|
|
14
|
def testVisitdir(self):
|
|
14
|
def testVisitdir(self):
|
|
15
|
m = matchmod.basematcher()
|
|
15
|
m = matchmod.basematcher()
|
|
16
|
self.assertTrue(m.visitdir(b'.'))
|
|
16
|
self.assertTrue(m.visitdir(b''))
|
|
17
|
self.assertTrue(m.visitdir(b'dir'))
|
|
17
|
self.assertTrue(m.visitdir(b'dir'))
|
|
18
|
|
|
18
|
|
|
19
|
def testVisitchildrenset(self):
|
|
19
|
def testVisitchildrenset(self):
|
|
20
|
m = matchmod.basematcher()
|
|
20
|
m = matchmod.basematcher()
|
|
21
|
self.assertEqual(m.visitchildrenset(b'.'), b'this')
|
|
21
|
self.assertEqual(m.visitchildrenset(b''), b'this')
|
|
22
|
self.assertEqual(m.visitchildrenset(b'dir'), b'this')
|
|
22
|
self.assertEqual(m.visitchildrenset(b'dir'), b'this')
|
|
23
|
|
|
23
|
|
|
24
|
class AlwaysMatcherTests(unittest.TestCase):
|
|
24
|
class AlwaysMatcherTests(unittest.TestCase):
|
|
25
|
|
|
25
|
|
|
26
|
def testVisitdir(self):
|
|
26
|
def testVisitdir(self):
|
|
27
|
m = matchmod.alwaysmatcher()
|
|
27
|
m = matchmod.alwaysmatcher()
|
|
28
|
self.assertEqual(m.visitdir(b'.'), b'all')
|
|
28
|
self.assertEqual(m.visitdir(b''), b'all')
|
|
29
|
self.assertEqual(m.visitdir(b'dir'), b'all')
|
|
29
|
self.assertEqual(m.visitdir(b'dir'), b'all')
|
|
30
|
|
|
30
|
|
|
31
|
def testVisitchildrenset(self):
|
|
31
|
def testVisitchildrenset(self):
|
|
32
|
m = matchmod.alwaysmatcher()
|
|
32
|
m = matchmod.alwaysmatcher()
|
|
33
|
self.assertEqual(m.visitchildrenset(b'.'), b'all')
|
|
33
|
self.assertEqual(m.visitchildrenset(b''), b'all')
|
|
34
|
self.assertEqual(m.visitchildrenset(b'dir'), b'all')
|
|
34
|
self.assertEqual(m.visitchildrenset(b'dir'), b'all')
|
|
35
|
|
|
35
|
|
|
36
|
class NeverMatcherTests(unittest.TestCase):
|
|
36
|
class NeverMatcherTests(unittest.TestCase):
|
|
37
|
|
|
37
|
|
|
38
|
def testVisitdir(self):
|
|
38
|
def testVisitdir(self):
|
|
39
|
m = matchmod.nevermatcher()
|
|
39
|
m = matchmod.nevermatcher()
|
|
40
|
self.assertFalse(m.visitdir(b'.'))
|
|
40
|
self.assertFalse(m.visitdir(b''))
|
|
41
|
self.assertFalse(m.visitdir(b'dir'))
|
|
41
|
self.assertFalse(m.visitdir(b'dir'))
|
|
42
|
|
|
42
|
|
|
43
|
def testVisitchildrenset(self):
|
|
43
|
def testVisitchildrenset(self):
|
|
44
|
m = matchmod.nevermatcher()
|
|
44
|
m = matchmod.nevermatcher()
|
|
45
|
self.assertEqual(m.visitchildrenset(b'.'), set())
|
|
45
|
self.assertEqual(m.visitchildrenset(b''), set())
|
|
46
|
self.assertEqual(m.visitchildrenset(b'dir'), set())
|
|
46
|
self.assertEqual(m.visitchildrenset(b'dir'), set())
|
|
47
|
|
|
47
|
|
|
48
|
class PredicateMatcherTests(unittest.TestCase):
|
|
48
|
class PredicateMatcherTests(unittest.TestCase):
|
|
@@
-51,12
+51,12
b' class PredicateMatcherTests(unittest.Tes'
|
|
51
|
|
|
51
|
|
|
52
|
def testVisitdir(self):
|
|
52
|
def testVisitdir(self):
|
|
53
|
m = matchmod.predicatematcher(lambda *a: False)
|
|
53
|
m = matchmod.predicatematcher(lambda *a: False)
|
|
54
|
self.assertTrue(m.visitdir(b'.'))
|
|
54
|
self.assertTrue(m.visitdir(b''))
|
|
55
|
self.assertTrue(m.visitdir(b'dir'))
|
|
55
|
self.assertTrue(m.visitdir(b'dir'))
|
|
56
|
|
|
56
|
|
|
57
|
def testVisitchildrenset(self):
|
|
57
|
def testVisitchildrenset(self):
|
|
58
|
m = matchmod.predicatematcher(lambda *a: False)
|
|
58
|
m = matchmod.predicatematcher(lambda *a: False)
|
|
59
|
self.assertEqual(m.visitchildrenset(b'.'), b'this')
|
|
59
|
self.assertEqual(m.visitchildrenset(b''), b'this')
|
|
60
|
self.assertEqual(m.visitchildrenset(b'dir'), b'this')
|
|
60
|
self.assertEqual(m.visitchildrenset(b'dir'), b'this')
|
|
61
|
|
|
61
|
|
|
62
|
class PatternMatcherTests(unittest.TestCase):
|
|
62
|
class PatternMatcherTests(unittest.TestCase):
|
|
@@
-64,7
+64,7
b' class PatternMatcherTests(unittest.TestC'
|
|
64
|
def testVisitdirPrefix(self):
|
|
64
|
def testVisitdirPrefix(self):
|
|
65
|
m = matchmod.match(b'x', b'', patterns=[b'path:dir/subdir'])
|
|
65
|
m = matchmod.match(b'x', b'', patterns=[b'path:dir/subdir'])
|
|
66
|
assert isinstance(m, matchmod.patternmatcher)
|
|
66
|
assert isinstance(m, matchmod.patternmatcher)
|
|
67
|
self.assertTrue(m.visitdir(b'.'))
|
|
67
|
self.assertTrue(m.visitdir(b''))
|
|
68
|
self.assertTrue(m.visitdir(b'dir'))
|
|
68
|
self.assertTrue(m.visitdir(b'dir'))
|
|
69
|
self.assertEqual(m.visitdir(b'dir/subdir'), b'all')
|
|
69
|
self.assertEqual(m.visitdir(b'dir/subdir'), b'all')
|
|
70
|
# OPT: This should probably be 'all' if its parent is?
|
|
70
|
# OPT: This should probably be 'all' if its parent is?
|
|
@@
-74,7
+74,7
b' class PatternMatcherTests(unittest.TestC'
|
|
74
|
def testVisitchildrensetPrefix(self):
|
|
74
|
def testVisitchildrensetPrefix(self):
|
|
75
|
m = matchmod.match(b'x', b'', patterns=[b'path:dir/subdir'])
|
|
75
|
m = matchmod.match(b'x', b'', patterns=[b'path:dir/subdir'])
|
|
76
|
assert isinstance(m, matchmod.patternmatcher)
|
|
76
|
assert isinstance(m, matchmod.patternmatcher)
|
|
77
|
self.assertEqual(m.visitchildrenset(b'.'), b'this')
|
|
77
|
self.assertEqual(m.visitchildrenset(b''), b'this')
|
|
78
|
self.assertEqual(m.visitchildrenset(b'dir'), b'this')
|
|
78
|
self.assertEqual(m.visitchildrenset(b'dir'), b'this')
|
|
79
|
self.assertEqual(m.visitchildrenset(b'dir/subdir'), b'all')
|
|
79
|
self.assertEqual(m.visitchildrenset(b'dir/subdir'), b'all')
|
|
80
|
# OPT: This should probably be 'all' if its parent is?
|
|
80
|
# OPT: This should probably be 'all' if its parent is?
|
|
@@
-84,7
+84,7
b' class PatternMatcherTests(unittest.TestC'
|
|
84
|
def testVisitdirRootfilesin(self):
|
|
84
|
def testVisitdirRootfilesin(self):
|
|
85
|
m = matchmod.match(b'x', b'', patterns=[b'rootfilesin:dir/subdir'])
|
|
85
|
m = matchmod.match(b'x', b'', patterns=[b'rootfilesin:dir/subdir'])
|
|
86
|
assert isinstance(m, matchmod.patternmatcher)
|
|
86
|
assert isinstance(m, matchmod.patternmatcher)
|
|
87
|
self.assertTrue(m.visitdir(b'.'))
|
|
87
|
self.assertTrue(m.visitdir(b''))
|
|
88
|
self.assertFalse(m.visitdir(b'dir/subdir/x'))
|
|
88
|
self.assertFalse(m.visitdir(b'dir/subdir/x'))
|
|
89
|
self.assertFalse(m.visitdir(b'folder'))
|
|
89
|
self.assertFalse(m.visitdir(b'folder'))
|
|
90
|
# FIXME: These should probably be True.
|
|
90
|
# FIXME: These should probably be True.
|
|
@@
-94,7
+94,7
b' class PatternMatcherTests(unittest.TestC'
|
|
94
|
def testVisitchildrensetRootfilesin(self):
|
|
94
|
def testVisitchildrensetRootfilesin(self):
|
|
95
|
m = matchmod.match(b'x', b'', patterns=[b'rootfilesin:dir/subdir'])
|
|
95
|
m = matchmod.match(b'x', b'', patterns=[b'rootfilesin:dir/subdir'])
|
|
96
|
assert isinstance(m, matchmod.patternmatcher)
|
|
96
|
assert isinstance(m, matchmod.patternmatcher)
|
|
97
|
self.assertEqual(m.visitchildrenset(b'.'), b'this')
|
|
97
|
self.assertEqual(m.visitchildrenset(b''), b'this')
|
|
98
|
self.assertEqual(m.visitchildrenset(b'dir/subdir/x'), set())
|
|
98
|
self.assertEqual(m.visitchildrenset(b'dir/subdir/x'), set())
|
|
99
|
self.assertEqual(m.visitchildrenset(b'folder'), set())
|
|
99
|
self.assertEqual(m.visitchildrenset(b'folder'), set())
|
|
100
|
# FIXME: These should probably be {'subdir'} and 'this', respectively,
|
|
100
|
# FIXME: These should probably be {'subdir'} and 'this', respectively,
|
|
@@
-105,7
+105,7
b' class PatternMatcherTests(unittest.TestC'
|
|
105
|
def testVisitdirGlob(self):
|
|
105
|
def testVisitdirGlob(self):
|
|
106
|
m = matchmod.match(b'x', b'', patterns=[b'glob:dir/z*'])
|
|
106
|
m = matchmod.match(b'x', b'', patterns=[b'glob:dir/z*'])
|
|
107
|
assert isinstance(m, matchmod.patternmatcher)
|
|
107
|
assert isinstance(m, matchmod.patternmatcher)
|
|
108
|
self.assertTrue(m.visitdir(b'.'))
|
|
108
|
self.assertTrue(m.visitdir(b''))
|
|
109
|
self.assertTrue(m.visitdir(b'dir'))
|
|
109
|
self.assertTrue(m.visitdir(b'dir'))
|
|
110
|
self.assertFalse(m.visitdir(b'folder'))
|
|
110
|
self.assertFalse(m.visitdir(b'folder'))
|
|
111
|
# OPT: these should probably be False.
|
|
111
|
# OPT: these should probably be False.
|
|
@@
-115,7
+115,7
b' class PatternMatcherTests(unittest.TestC'
|
|
115
|
def testVisitchildrensetGlob(self):
|
|
115
|
def testVisitchildrensetGlob(self):
|
|
116
|
m = matchmod.match(b'x', b'', patterns=[b'glob:dir/z*'])
|
|
116
|
m = matchmod.match(b'x', b'', patterns=[b'glob:dir/z*'])
|
|
117
|
assert isinstance(m, matchmod.patternmatcher)
|
|
117
|
assert isinstance(m, matchmod.patternmatcher)
|
|
118
|
self.assertEqual(m.visitchildrenset(b'.'), b'this')
|
|
118
|
self.assertEqual(m.visitchildrenset(b''), b'this')
|
|
119
|
self.assertEqual(m.visitchildrenset(b'folder'), set())
|
|
119
|
self.assertEqual(m.visitchildrenset(b'folder'), set())
|
|
120
|
self.assertEqual(m.visitchildrenset(b'dir'), b'this')
|
|
120
|
self.assertEqual(m.visitchildrenset(b'dir'), b'this')
|
|
121
|
# OPT: these should probably be set().
|
|
121
|
# OPT: these should probably be set().
|
|
@@
-127,7
+127,7
b' class IncludeMatcherTests(unittest.TestC'
|
|
127
|
def testVisitdirPrefix(self):
|
|
127
|
def testVisitdirPrefix(self):
|
|
128
|
m = matchmod.match(b'x', b'', include=[b'path:dir/subdir'])
|
|
128
|
m = matchmod.match(b'x', b'', include=[b'path:dir/subdir'])
|
|
129
|
assert isinstance(m, matchmod.includematcher)
|
|
129
|
assert isinstance(m, matchmod.includematcher)
|
|
130
|
self.assertTrue(m.visitdir(b'.'))
|
|
130
|
self.assertTrue(m.visitdir(b''))
|
|
131
|
self.assertTrue(m.visitdir(b'dir'))
|
|
131
|
self.assertTrue(m.visitdir(b'dir'))
|
|
132
|
self.assertEqual(m.visitdir(b'dir/subdir'), b'all')
|
|
132
|
self.assertEqual(m.visitdir(b'dir/subdir'), b'all')
|
|
133
|
# OPT: This should probably be 'all' if its parent is?
|
|
133
|
# OPT: This should probably be 'all' if its parent is?
|
|
@@
-137,7
+137,7
b' class IncludeMatcherTests(unittest.TestC'
|
|
137
|
def testVisitchildrensetPrefix(self):
|
|
137
|
def testVisitchildrensetPrefix(self):
|
|
138
|
m = matchmod.match(b'x', b'', include=[b'path:dir/subdir'])
|
|
138
|
m = matchmod.match(b'x', b'', include=[b'path:dir/subdir'])
|
|
139
|
assert isinstance(m, matchmod.includematcher)
|
|
139
|
assert isinstance(m, matchmod.includematcher)
|
|
140
|
self.assertEqual(m.visitchildrenset(b'.'), {b'dir'})
|
|
140
|
self.assertEqual(m.visitchildrenset(b''), {b'dir'})
|
|
141
|
self.assertEqual(m.visitchildrenset(b'dir'), {b'subdir'})
|
|
141
|
self.assertEqual(m.visitchildrenset(b'dir'), {b'subdir'})
|
|
142
|
self.assertEqual(m.visitchildrenset(b'dir/subdir'), b'all')
|
|
142
|
self.assertEqual(m.visitchildrenset(b'dir/subdir'), b'all')
|
|
143
|
# OPT: This should probably be 'all' if its parent is?
|
|
143
|
# OPT: This should probably be 'all' if its parent is?
|
|
@@
-147,7
+147,7
b' class IncludeMatcherTests(unittest.TestC'
|
|
147
|
def testVisitdirRootfilesin(self):
|
|
147
|
def testVisitdirRootfilesin(self):
|
|
148
|
m = matchmod.match(b'x', b'', include=[b'rootfilesin:dir/subdir'])
|
|
148
|
m = matchmod.match(b'x', b'', include=[b'rootfilesin:dir/subdir'])
|
|
149
|
assert isinstance(m, matchmod.includematcher)
|
|
149
|
assert isinstance(m, matchmod.includematcher)
|
|
150
|
self.assertTrue(m.visitdir(b'.'))
|
|
150
|
self.assertTrue(m.visitdir(b''))
|
|
151
|
self.assertTrue(m.visitdir(b'dir'))
|
|
151
|
self.assertTrue(m.visitdir(b'dir'))
|
|
152
|
self.assertTrue(m.visitdir(b'dir/subdir'))
|
|
152
|
self.assertTrue(m.visitdir(b'dir/subdir'))
|
|
153
|
self.assertFalse(m.visitdir(b'dir/subdir/x'))
|
|
153
|
self.assertFalse(m.visitdir(b'dir/subdir/x'))
|
|
@@
-156,7
+156,7
b' class IncludeMatcherTests(unittest.TestC'
|
|
156
|
def testVisitchildrensetRootfilesin(self):
|
|
156
|
def testVisitchildrensetRootfilesin(self):
|
|
157
|
m = matchmod.match(b'x', b'', include=[b'rootfilesin:dir/subdir'])
|
|
157
|
m = matchmod.match(b'x', b'', include=[b'rootfilesin:dir/subdir'])
|
|
158
|
assert isinstance(m, matchmod.includematcher)
|
|
158
|
assert isinstance(m, matchmod.includematcher)
|
|
159
|
self.assertEqual(m.visitchildrenset(b'.'), {b'dir'})
|
|
159
|
self.assertEqual(m.visitchildrenset(b''), {b'dir'})
|
|
160
|
self.assertEqual(m.visitchildrenset(b'dir'), {b'subdir'})
|
|
160
|
self.assertEqual(m.visitchildrenset(b'dir'), {b'subdir'})
|
|
161
|
self.assertEqual(m.visitchildrenset(b'dir/subdir'), b'this')
|
|
161
|
self.assertEqual(m.visitchildrenset(b'dir/subdir'), b'this')
|
|
162
|
self.assertEqual(m.visitchildrenset(b'dir/subdir/x'), set())
|
|
162
|
self.assertEqual(m.visitchildrenset(b'dir/subdir/x'), set())
|
|
@@
-165,7
+165,7
b' class IncludeMatcherTests(unittest.TestC'
|
|
165
|
def testVisitdirGlob(self):
|
|
165
|
def testVisitdirGlob(self):
|
|
166
|
m = matchmod.match(b'x', b'', include=[b'glob:dir/z*'])
|
|
166
|
m = matchmod.match(b'x', b'', include=[b'glob:dir/z*'])
|
|
167
|
assert isinstance(m, matchmod.includematcher)
|
|
167
|
assert isinstance(m, matchmod.includematcher)
|
|
168
|
self.assertTrue(m.visitdir(b'.'))
|
|
168
|
self.assertTrue(m.visitdir(b''))
|
|
169
|
self.assertTrue(m.visitdir(b'dir'))
|
|
169
|
self.assertTrue(m.visitdir(b'dir'))
|
|
170
|
self.assertFalse(m.visitdir(b'folder'))
|
|
170
|
self.assertFalse(m.visitdir(b'folder'))
|
|
171
|
# OPT: these should probably be False.
|
|
171
|
# OPT: these should probably be False.
|
|
@@
-175,7
+175,7
b' class IncludeMatcherTests(unittest.TestC'
|
|
175
|
def testVisitchildrensetGlob(self):
|
|
175
|
def testVisitchildrensetGlob(self):
|
|
176
|
m = matchmod.match(b'x', b'', include=[b'glob:dir/z*'])
|
|
176
|
m = matchmod.match(b'x', b'', include=[b'glob:dir/z*'])
|
|
177
|
assert isinstance(m, matchmod.includematcher)
|
|
177
|
assert isinstance(m, matchmod.includematcher)
|
|
178
|
self.assertEqual(m.visitchildrenset(b'.'), {b'dir'})
|
|
178
|
self.assertEqual(m.visitchildrenset(b''), {b'dir'})
|
|
179
|
self.assertEqual(m.visitchildrenset(b'folder'), set())
|
|
179
|
self.assertEqual(m.visitchildrenset(b'folder'), set())
|
|
180
|
self.assertEqual(m.visitchildrenset(b'dir'), b'this')
|
|
180
|
self.assertEqual(m.visitchildrenset(b'dir'), b'this')
|
|
181
|
# OPT: these should probably be set().
|
|
181
|
# OPT: these should probably be set().
|
|
@@
-187,7
+187,7
b' class ExactMatcherTests(unittest.TestCas'
|
|
187
|
def testVisitdir(self):
|
|
187
|
def testVisitdir(self):
|
|
188
|
m = matchmod.exact(files=[b'dir/subdir/foo.txt'])
|
|
188
|
m = matchmod.exact(files=[b'dir/subdir/foo.txt'])
|
|
189
|
assert isinstance(m, matchmod.exactmatcher)
|
|
189
|
assert isinstance(m, matchmod.exactmatcher)
|
|
190
|
self.assertTrue(m.visitdir(b'.'))
|
|
190
|
self.assertTrue(m.visitdir(b''))
|
|
191
|
self.assertTrue(m.visitdir(b'dir'))
|
|
191
|
self.assertTrue(m.visitdir(b'dir'))
|
|
192
|
self.assertTrue(m.visitdir(b'dir/subdir'))
|
|
192
|
self.assertTrue(m.visitdir(b'dir/subdir'))
|
|
193
|
self.assertFalse(m.visitdir(b'dir/subdir/foo.txt'))
|
|
193
|
self.assertFalse(m.visitdir(b'dir/subdir/foo.txt'))
|
|
@@
-198,7
+198,7
b' class ExactMatcherTests(unittest.TestCas'
|
|
198
|
def testVisitchildrenset(self):
|
|
198
|
def testVisitchildrenset(self):
|
|
199
|
m = matchmod.exact(files=[b'dir/subdir/foo.txt'])
|
|
199
|
m = matchmod.exact(files=[b'dir/subdir/foo.txt'])
|
|
200
|
assert isinstance(m, matchmod.exactmatcher)
|
|
200
|
assert isinstance(m, matchmod.exactmatcher)
|
|
201
|
self.assertEqual(m.visitchildrenset(b'.'), {b'dir'})
|
|
201
|
self.assertEqual(m.visitchildrenset(b''), {b'dir'})
|
|
202
|
self.assertEqual(m.visitchildrenset(b'dir'), {b'subdir'})
|
|
202
|
self.assertEqual(m.visitchildrenset(b'dir'), {b'subdir'})
|
|
203
|
self.assertEqual(m.visitchildrenset(b'dir/subdir'), {b'foo.txt'})
|
|
203
|
self.assertEqual(m.visitchildrenset(b'dir/subdir'), {b'foo.txt'})
|
|
204
|
self.assertEqual(m.visitchildrenset(b'dir/subdir/x'), set())
|
|
204
|
self.assertEqual(m.visitchildrenset(b'dir/subdir/x'), set())
|
|
@@
-212,7
+212,7
b' class ExactMatcherTests(unittest.TestCas'
|
|
212
|
# no file in a/b/c
|
|
212
|
# no file in a/b/c
|
|
213
|
b'a/b/c/d/file4.txt'])
|
|
213
|
b'a/b/c/d/file4.txt'])
|
|
214
|
assert isinstance(m, matchmod.exactmatcher)
|
|
214
|
assert isinstance(m, matchmod.exactmatcher)
|
|
215
|
self.assertEqual(m.visitchildrenset(b'.'), {b'a', b'rootfile.txt'})
|
|
215
|
self.assertEqual(m.visitchildrenset(b''), {b'a', b'rootfile.txt'})
|
|
216
|
self.assertEqual(m.visitchildrenset(b'a'), {b'b', b'file1.txt'})
|
|
216
|
self.assertEqual(m.visitchildrenset(b'a'), {b'b', b'file1.txt'})
|
|
217
|
self.assertEqual(m.visitchildrenset(b'a/b'), {b'c', b'file2.txt'})
|
|
217
|
self.assertEqual(m.visitchildrenset(b'a/b'), {b'c', b'file2.txt'})
|
|
218
|
self.assertEqual(m.visitchildrenset(b'a/b/c'), {b'd'})
|
|
218
|
self.assertEqual(m.visitchildrenset(b'a/b/c'), {b'd'})
|
|
@@
-227,7
+227,7
b' class DifferenceMatcherTests(unittest.Te'
|
|
227
|
m2 = matchmod.alwaysmatcher()
|
|
227
|
m2 = matchmod.alwaysmatcher()
|
|
228
|
dm = matchmod.differencematcher(m1, m2)
|
|
228
|
dm = matchmod.differencematcher(m1, m2)
|
|
229
|
# dm should be equivalent to a nevermatcher.
|
|
229
|
# dm should be equivalent to a nevermatcher.
|
|
230
|
self.assertFalse(dm.visitdir(b'.'))
|
|
230
|
self.assertFalse(dm.visitdir(b''))
|
|
231
|
self.assertFalse(dm.visitdir(b'dir'))
|
|
231
|
self.assertFalse(dm.visitdir(b'dir'))
|
|
232
|
self.assertFalse(dm.visitdir(b'dir/subdir'))
|
|
232
|
self.assertFalse(dm.visitdir(b'dir/subdir'))
|
|
233
|
self.assertFalse(dm.visitdir(b'dir/subdir/z'))
|
|
233
|
self.assertFalse(dm.visitdir(b'dir/subdir/z'))
|
|
@@
-240,7
+240,7
b' class DifferenceMatcherTests(unittest.Te'
|
|
240
|
m2 = matchmod.alwaysmatcher()
|
|
240
|
m2 = matchmod.alwaysmatcher()
|
|
241
|
dm = matchmod.differencematcher(m1, m2)
|
|
241
|
dm = matchmod.differencematcher(m1, m2)
|
|
242
|
# dm should be equivalent to a nevermatcher.
|
|
242
|
# dm should be equivalent to a nevermatcher.
|
|
243
|
self.assertEqual(dm.visitchildrenset(b'.'), set())
|
|
243
|
self.assertEqual(dm.visitchildrenset(b''), set())
|
|
244
|
self.assertEqual(dm.visitchildrenset(b'dir'), set())
|
|
244
|
self.assertEqual(dm.visitchildrenset(b'dir'), set())
|
|
245
|
self.assertEqual(dm.visitchildrenset(b'dir/subdir'), set())
|
|
245
|
self.assertEqual(dm.visitchildrenset(b'dir/subdir'), set())
|
|
246
|
self.assertEqual(dm.visitchildrenset(b'dir/subdir/z'), set())
|
|
246
|
self.assertEqual(dm.visitchildrenset(b'dir/subdir/z'), set())
|
|
@@
-258,7
+258,7
b' class DifferenceMatcherTests(unittest.Te'
|
|
258
|
# assertTrue does NOT verify that it's a bool, just that it's truthy.
|
|
258
|
# assertTrue does NOT verify that it's a bool, just that it's truthy.
|
|
259
|
# While we may want to eventually make these return 'all', they should
|
|
259
|
# While we may want to eventually make these return 'all', they should
|
|
260
|
# not currently do so.
|
|
260
|
# not currently do so.
|
|
261
|
self.assertEqual(dm.visitdir(b'.'), b'all')
|
|
261
|
self.assertEqual(dm.visitdir(b''), b'all')
|
|
262
|
self.assertEqual(dm.visitdir(b'dir'), b'all')
|
|
262
|
self.assertEqual(dm.visitdir(b'dir'), b'all')
|
|
263
|
self.assertEqual(dm.visitdir(b'dir/subdir'), b'all')
|
|
263
|
self.assertEqual(dm.visitdir(b'dir/subdir'), b'all')
|
|
264
|
self.assertEqual(dm.visitdir(b'dir/subdir/z'), b'all')
|
|
264
|
self.assertEqual(dm.visitdir(b'dir/subdir/z'), b'all')
|
|
@@
-271,7
+271,7
b' class DifferenceMatcherTests(unittest.Te'
|
|
271
|
m2 = matchmod.nevermatcher()
|
|
271
|
m2 = matchmod.nevermatcher()
|
|
272
|
dm = matchmod.differencematcher(m1, m2)
|
|
272
|
dm = matchmod.differencematcher(m1, m2)
|
|
273
|
# dm should be equivalent to a alwaysmatcher.
|
|
273
|
# dm should be equivalent to a alwaysmatcher.
|
|
274
|
self.assertEqual(dm.visitchildrenset(b'.'), b'all')
|
|
274
|
self.assertEqual(dm.visitchildrenset(b''), b'all')
|
|
275
|
self.assertEqual(dm.visitchildrenset(b'dir'), b'all')
|
|
275
|
self.assertEqual(dm.visitchildrenset(b'dir'), b'all')
|
|
276
|
self.assertEqual(dm.visitchildrenset(b'dir/subdir'), b'all')
|
|
276
|
self.assertEqual(dm.visitchildrenset(b'dir/subdir'), b'all')
|
|
277
|
self.assertEqual(dm.visitchildrenset(b'dir/subdir/z'), b'all')
|
|
277
|
self.assertEqual(dm.visitchildrenset(b'dir/subdir/z'), b'all')
|
|
@@
-283,7
+283,7
b' class DifferenceMatcherTests(unittest.Te'
|
|
283
|
m1 = matchmod.alwaysmatcher()
|
|
283
|
m1 = matchmod.alwaysmatcher()
|
|
284
|
m2 = matchmod.match(b'', b'', patterns=[b'path:dir/subdir'])
|
|
284
|
m2 = matchmod.match(b'', b'', patterns=[b'path:dir/subdir'])
|
|
285
|
dm = matchmod.differencematcher(m1, m2)
|
|
285
|
dm = matchmod.differencematcher(m1, m2)
|
|
286
|
self.assertEqual(dm.visitdir(b'.'), True)
|
|
286
|
self.assertEqual(dm.visitdir(b''), True)
|
|
287
|
self.assertEqual(dm.visitdir(b'dir'), True)
|
|
287
|
self.assertEqual(dm.visitdir(b'dir'), True)
|
|
288
|
self.assertFalse(dm.visitdir(b'dir/subdir'))
|
|
288
|
self.assertFalse(dm.visitdir(b'dir/subdir'))
|
|
289
|
# OPT: We should probably return False for these; we don't because
|
|
289
|
# OPT: We should probably return False for these; we don't because
|
|
@@
-298,7
+298,7
b' class DifferenceMatcherTests(unittest.Te'
|
|
298
|
m1 = matchmod.alwaysmatcher()
|
|
298
|
m1 = matchmod.alwaysmatcher()
|
|
299
|
m2 = matchmod.match(b'', b'', patterns=[b'path:dir/subdir'])
|
|
299
|
m2 = matchmod.match(b'', b'', patterns=[b'path:dir/subdir'])
|
|
300
|
dm = matchmod.differencematcher(m1, m2)
|
|
300
|
dm = matchmod.differencematcher(m1, m2)
|
|
301
|
self.assertEqual(dm.visitchildrenset(b'.'), b'this')
|
|
301
|
self.assertEqual(dm.visitchildrenset(b''), b'this')
|
|
302
|
self.assertEqual(dm.visitchildrenset(b'dir'), b'this')
|
|
302
|
self.assertEqual(dm.visitchildrenset(b'dir'), b'this')
|
|
303
|
self.assertEqual(dm.visitchildrenset(b'dir/subdir'), set())
|
|
303
|
self.assertEqual(dm.visitchildrenset(b'dir/subdir'), set())
|
|
304
|
self.assertEqual(dm.visitchildrenset(b'dir/foo'), b'all')
|
|
304
|
self.assertEqual(dm.visitchildrenset(b'dir/foo'), b'all')
|
|
@@
-315,7
+315,7
b' class DifferenceMatcherTests(unittest.Te'
|
|
315
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
315
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
316
|
m2 = matchmod.match(b'', b'', include=[b'rootfilesin:dir'])
|
|
316
|
m2 = matchmod.match(b'', b'', include=[b'rootfilesin:dir'])
|
|
317
|
dm = matchmod.differencematcher(m1, m2)
|
|
317
|
dm = matchmod.differencematcher(m1, m2)
|
|
318
|
self.assertEqual(dm.visitdir(b'.'), True)
|
|
318
|
self.assertEqual(dm.visitdir(b''), True)
|
|
319
|
self.assertEqual(dm.visitdir(b'dir'), True)
|
|
319
|
self.assertEqual(dm.visitdir(b'dir'), True)
|
|
320
|
self.assertEqual(dm.visitdir(b'dir/subdir'), b'all')
|
|
320
|
self.assertEqual(dm.visitdir(b'dir/subdir'), b'all')
|
|
321
|
self.assertFalse(dm.visitdir(b'dir/foo'))
|
|
321
|
self.assertFalse(dm.visitdir(b'dir/foo'))
|
|
@@
-330,7
+330,7
b' class DifferenceMatcherTests(unittest.Te'
|
|
330
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
330
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
331
|
m2 = matchmod.match(b'', b'', include=[b'rootfilesin:dir'])
|
|
331
|
m2 = matchmod.match(b'', b'', include=[b'rootfilesin:dir'])
|
|
332
|
dm = matchmod.differencematcher(m1, m2)
|
|
332
|
dm = matchmod.differencematcher(m1, m2)
|
|
333
|
self.assertEqual(dm.visitchildrenset(b'.'), {b'dir'})
|
|
333
|
self.assertEqual(dm.visitchildrenset(b''), {b'dir'})
|
|
334
|
self.assertEqual(dm.visitchildrenset(b'dir'), {b'subdir'})
|
|
334
|
self.assertEqual(dm.visitchildrenset(b'dir'), {b'subdir'})
|
|
335
|
self.assertEqual(dm.visitchildrenset(b'dir/subdir'), b'all')
|
|
335
|
self.assertEqual(dm.visitchildrenset(b'dir/subdir'), b'all')
|
|
336
|
self.assertEqual(dm.visitchildrenset(b'dir/foo'), set())
|
|
336
|
self.assertEqual(dm.visitchildrenset(b'dir/foo'), set())
|
|
@@
-348,7
+348,7
b' class IntersectionMatcherTests(unittest.'
|
|
348
|
m2 = matchmod.alwaysmatcher()
|
|
348
|
m2 = matchmod.alwaysmatcher()
|
|
349
|
im = matchmod.intersectmatchers(m1, m2)
|
|
349
|
im = matchmod.intersectmatchers(m1, m2)
|
|
350
|
# im should be equivalent to a alwaysmatcher.
|
|
350
|
# im should be equivalent to a alwaysmatcher.
|
|
351
|
self.assertEqual(im.visitdir(b'.'), b'all')
|
|
351
|
self.assertEqual(im.visitdir(b''), b'all')
|
|
352
|
self.assertEqual(im.visitdir(b'dir'), b'all')
|
|
352
|
self.assertEqual(im.visitdir(b'dir'), b'all')
|
|
353
|
self.assertEqual(im.visitdir(b'dir/subdir'), b'all')
|
|
353
|
self.assertEqual(im.visitdir(b'dir/subdir'), b'all')
|
|
354
|
self.assertEqual(im.visitdir(b'dir/subdir/z'), b'all')
|
|
354
|
self.assertEqual(im.visitdir(b'dir/subdir/z'), b'all')
|
|
@@
-361,7
+361,7
b' class IntersectionMatcherTests(unittest.'
|
|
361
|
m2 = matchmod.alwaysmatcher()
|
|
361
|
m2 = matchmod.alwaysmatcher()
|
|
362
|
im = matchmod.intersectmatchers(m1, m2)
|
|
362
|
im = matchmod.intersectmatchers(m1, m2)
|
|
363
|
# im should be equivalent to a alwaysmatcher.
|
|
363
|
# im should be equivalent to a alwaysmatcher.
|
|
364
|
self.assertEqual(im.visitchildrenset(b'.'), b'all')
|
|
364
|
self.assertEqual(im.visitchildrenset(b''), b'all')
|
|
365
|
self.assertEqual(im.visitchildrenset(b'dir'), b'all')
|
|
365
|
self.assertEqual(im.visitchildrenset(b'dir'), b'all')
|
|
366
|
self.assertEqual(im.visitchildrenset(b'dir/subdir'), b'all')
|
|
366
|
self.assertEqual(im.visitchildrenset(b'dir/subdir'), b'all')
|
|
367
|
self.assertEqual(im.visitchildrenset(b'dir/subdir/z'), b'all')
|
|
367
|
self.assertEqual(im.visitchildrenset(b'dir/subdir/z'), b'all')
|
|
@@
-374,7
+374,7
b' class IntersectionMatcherTests(unittest.'
|
|
374
|
m2 = matchmod.nevermatcher()
|
|
374
|
m2 = matchmod.nevermatcher()
|
|
375
|
im = matchmod.intersectmatchers(m1, m2)
|
|
375
|
im = matchmod.intersectmatchers(m1, m2)
|
|
376
|
# im should be equivalent to a nevermatcher.
|
|
376
|
# im should be equivalent to a nevermatcher.
|
|
377
|
self.assertFalse(im.visitdir(b'.'))
|
|
377
|
self.assertFalse(im.visitdir(b''))
|
|
378
|
self.assertFalse(im.visitdir(b'dir'))
|
|
378
|
self.assertFalse(im.visitdir(b'dir'))
|
|
379
|
self.assertFalse(im.visitdir(b'dir/subdir'))
|
|
379
|
self.assertFalse(im.visitdir(b'dir/subdir'))
|
|
380
|
self.assertFalse(im.visitdir(b'dir/subdir/z'))
|
|
380
|
self.assertFalse(im.visitdir(b'dir/subdir/z'))
|
|
@@
-387,7
+387,7
b' class IntersectionMatcherTests(unittest.'
|
|
387
|
m2 = matchmod.nevermatcher()
|
|
387
|
m2 = matchmod.nevermatcher()
|
|
388
|
im = matchmod.intersectmatchers(m1, m2)
|
|
388
|
im = matchmod.intersectmatchers(m1, m2)
|
|
389
|
# im should be equivalent to a nevermqtcher.
|
|
389
|
# im should be equivalent to a nevermqtcher.
|
|
390
|
self.assertEqual(im.visitchildrenset(b'.'), set())
|
|
390
|
self.assertEqual(im.visitchildrenset(b''), set())
|
|
391
|
self.assertEqual(im.visitchildrenset(b'dir'), set())
|
|
391
|
self.assertEqual(im.visitchildrenset(b'dir'), set())
|
|
392
|
self.assertEqual(im.visitchildrenset(b'dir/subdir'), set())
|
|
392
|
self.assertEqual(im.visitchildrenset(b'dir/subdir'), set())
|
|
393
|
self.assertEqual(im.visitchildrenset(b'dir/subdir/z'), set())
|
|
393
|
self.assertEqual(im.visitchildrenset(b'dir/subdir/z'), set())
|
|
@@
-399,7
+399,7
b' class IntersectionMatcherTests(unittest.'
|
|
399
|
m1 = matchmod.alwaysmatcher()
|
|
399
|
m1 = matchmod.alwaysmatcher()
|
|
400
|
m2 = matchmod.match(b'', b'', patterns=[b'path:dir/subdir'])
|
|
400
|
m2 = matchmod.match(b'', b'', patterns=[b'path:dir/subdir'])
|
|
401
|
im = matchmod.intersectmatchers(m1, m2)
|
|
401
|
im = matchmod.intersectmatchers(m1, m2)
|
|
402
|
self.assertEqual(im.visitdir(b'.'), True)
|
|
402
|
self.assertEqual(im.visitdir(b''), True)
|
|
403
|
self.assertEqual(im.visitdir(b'dir'), True)
|
|
403
|
self.assertEqual(im.visitdir(b'dir'), True)
|
|
404
|
self.assertEqual(im.visitdir(b'dir/subdir'), b'all')
|
|
404
|
self.assertEqual(im.visitdir(b'dir/subdir'), b'all')
|
|
405
|
self.assertFalse(im.visitdir(b'dir/foo'))
|
|
405
|
self.assertFalse(im.visitdir(b'dir/foo'))
|
|
@@
-414,7
+414,7
b' class IntersectionMatcherTests(unittest.'
|
|
414
|
m1 = matchmod.alwaysmatcher()
|
|
414
|
m1 = matchmod.alwaysmatcher()
|
|
415
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
415
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
416
|
im = matchmod.intersectmatchers(m1, m2)
|
|
416
|
im = matchmod.intersectmatchers(m1, m2)
|
|
417
|
self.assertEqual(im.visitchildrenset(b'.'), {b'dir'})
|
|
417
|
self.assertEqual(im.visitchildrenset(b''), {b'dir'})
|
|
418
|
self.assertEqual(im.visitchildrenset(b'dir'), {b'subdir'})
|
|
418
|
self.assertEqual(im.visitchildrenset(b'dir'), {b'subdir'})
|
|
419
|
self.assertEqual(im.visitchildrenset(b'dir/subdir'), b'all')
|
|
419
|
self.assertEqual(im.visitchildrenset(b'dir/subdir'), b'all')
|
|
420
|
self.assertEqual(im.visitchildrenset(b'dir/foo'), set())
|
|
420
|
self.assertEqual(im.visitchildrenset(b'dir/foo'), set())
|
|
@@
-429,7
+429,7
b' class IntersectionMatcherTests(unittest.'
|
|
429
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
429
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
430
|
m2 = matchmod.match(b'', b'', include=[b'rootfilesin:dir'])
|
|
430
|
m2 = matchmod.match(b'', b'', include=[b'rootfilesin:dir'])
|
|
431
|
im = matchmod.intersectmatchers(m1, m2)
|
|
431
|
im = matchmod.intersectmatchers(m1, m2)
|
|
432
|
self.assertEqual(im.visitdir(b'.'), True)
|
|
432
|
self.assertEqual(im.visitdir(b''), True)
|
|
433
|
self.assertEqual(im.visitdir(b'dir'), True)
|
|
433
|
self.assertEqual(im.visitdir(b'dir'), True)
|
|
434
|
self.assertFalse(im.visitdir(b'dir/subdir'))
|
|
434
|
self.assertFalse(im.visitdir(b'dir/subdir'))
|
|
435
|
self.assertFalse(im.visitdir(b'dir/foo'))
|
|
435
|
self.assertFalse(im.visitdir(b'dir/foo'))
|
|
@@
-441,7
+441,7
b' class IntersectionMatcherTests(unittest.'
|
|
441
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
441
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
442
|
m2 = matchmod.match(b'', b'', include=[b'rootfilesin:dir'])
|
|
442
|
m2 = matchmod.match(b'', b'', include=[b'rootfilesin:dir'])
|
|
443
|
im = matchmod.intersectmatchers(m1, m2)
|
|
443
|
im = matchmod.intersectmatchers(m1, m2)
|
|
444
|
self.assertEqual(im.visitchildrenset(b'.'), {b'dir'})
|
|
444
|
self.assertEqual(im.visitchildrenset(b''), {b'dir'})
|
|
445
|
self.assertEqual(im.visitchildrenset(b'dir'), b'this')
|
|
445
|
self.assertEqual(im.visitchildrenset(b'dir'), b'this')
|
|
446
|
self.assertEqual(im.visitchildrenset(b'dir/subdir'), set())
|
|
446
|
self.assertEqual(im.visitchildrenset(b'dir/subdir'), set())
|
|
447
|
self.assertEqual(im.visitchildrenset(b'dir/foo'), set())
|
|
447
|
self.assertEqual(im.visitchildrenset(b'dir/foo'), set())
|
|
@@
-456,7
+456,7
b' class IntersectionMatcherTests(unittest.'
|
|
456
|
m2 = matchmod.match(b'', b'', include=[b'path:folder'])
|
|
456
|
m2 = matchmod.match(b'', b'', include=[b'path:folder'])
|
|
457
|
im = matchmod.intersectmatchers(m1, m2)
|
|
457
|
im = matchmod.intersectmatchers(m1, m2)
|
|
458
|
# FIXME: is True correct here?
|
|
458
|
# FIXME: is True correct here?
|
|
459
|
self.assertEqual(im.visitdir(b'.'), True)
|
|
459
|
self.assertEqual(im.visitdir(b''), True)
|
|
460
|
self.assertFalse(im.visitdir(b'dir'))
|
|
460
|
self.assertFalse(im.visitdir(b'dir'))
|
|
461
|
self.assertFalse(im.visitdir(b'dir/subdir'))
|
|
461
|
self.assertFalse(im.visitdir(b'dir/subdir'))
|
|
462
|
self.assertFalse(im.visitdir(b'dir/foo'))
|
|
462
|
self.assertFalse(im.visitdir(b'dir/foo'))
|
|
@@
-469,7
+469,7
b' class IntersectionMatcherTests(unittest.'
|
|
469
|
m2 = matchmod.match(b'', b'', include=[b'path:folder'])
|
|
469
|
m2 = matchmod.match(b'', b'', include=[b'path:folder'])
|
|
470
|
im = matchmod.intersectmatchers(m1, m2)
|
|
470
|
im = matchmod.intersectmatchers(m1, m2)
|
|
471
|
# FIXME: is set() correct here?
|
|
471
|
# FIXME: is set() correct here?
|
|
472
|
self.assertEqual(im.visitchildrenset(b'.'), set())
|
|
472
|
self.assertEqual(im.visitchildrenset(b''), set())
|
|
473
|
self.assertEqual(im.visitchildrenset(b'dir'), set())
|
|
473
|
self.assertEqual(im.visitchildrenset(b'dir'), set())
|
|
474
|
self.assertEqual(im.visitchildrenset(b'dir/subdir'), set())
|
|
474
|
self.assertEqual(im.visitchildrenset(b'dir/subdir'), set())
|
|
475
|
self.assertEqual(im.visitchildrenset(b'dir/foo'), set())
|
|
475
|
self.assertEqual(im.visitchildrenset(b'dir/foo'), set())
|
|
@@
-483,7
+483,7
b' class IntersectionMatcherTests(unittest.'
|
|
483
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir/x'])
|
|
483
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir/x'])
|
|
484
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
484
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
485
|
im = matchmod.intersectmatchers(m1, m2)
|
|
485
|
im = matchmod.intersectmatchers(m1, m2)
|
|
486
|
self.assertEqual(im.visitdir(b'.'), True)
|
|
486
|
self.assertEqual(im.visitdir(b''), True)
|
|
487
|
self.assertEqual(im.visitdir(b'dir'), True)
|
|
487
|
self.assertEqual(im.visitdir(b'dir'), True)
|
|
488
|
self.assertEqual(im.visitdir(b'dir/subdir'), True)
|
|
488
|
self.assertEqual(im.visitdir(b'dir/subdir'), True)
|
|
489
|
self.assertFalse(im.visitdir(b'dir/foo'))
|
|
489
|
self.assertFalse(im.visitdir(b'dir/foo'))
|
|
@@
-496,7
+496,7
b' class IntersectionMatcherTests(unittest.'
|
|
496
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir/x'])
|
|
496
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir/x'])
|
|
497
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
497
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
498
|
im = matchmod.intersectmatchers(m1, m2)
|
|
498
|
im = matchmod.intersectmatchers(m1, m2)
|
|
499
|
self.assertEqual(im.visitchildrenset(b'.'), {b'dir'})
|
|
499
|
self.assertEqual(im.visitchildrenset(b''), {b'dir'})
|
|
500
|
self.assertEqual(im.visitchildrenset(b'dir'), {b'subdir'})
|
|
500
|
self.assertEqual(im.visitchildrenset(b'dir'), {b'subdir'})
|
|
501
|
self.assertEqual(im.visitchildrenset(b'dir/subdir'), {b'x'})
|
|
501
|
self.assertEqual(im.visitchildrenset(b'dir/subdir'), {b'x'})
|
|
502
|
self.assertEqual(im.visitchildrenset(b'dir/foo'), set())
|
|
502
|
self.assertEqual(im.visitchildrenset(b'dir/foo'), set())
|
|
@@
-512,7
+512,7
b' class IntersectionMatcherTests(unittest.'
|
|
512
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir/z'])
|
|
512
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir/z'])
|
|
513
|
im = matchmod.intersectmatchers(m1, m2)
|
|
513
|
im = matchmod.intersectmatchers(m1, m2)
|
|
514
|
# OPT: these next three could probably be False as well.
|
|
514
|
# OPT: these next three could probably be False as well.
|
|
515
|
self.assertEqual(im.visitdir(b'.'), True)
|
|
515
|
self.assertEqual(im.visitdir(b''), True)
|
|
516
|
self.assertEqual(im.visitdir(b'dir'), True)
|
|
516
|
self.assertEqual(im.visitdir(b'dir'), True)
|
|
517
|
self.assertEqual(im.visitdir(b'dir/subdir'), True)
|
|
517
|
self.assertEqual(im.visitdir(b'dir/subdir'), True)
|
|
518
|
self.assertFalse(im.visitdir(b'dir/foo'))
|
|
518
|
self.assertFalse(im.visitdir(b'dir/foo'))
|
|
@@
-525,7
+525,7
b' class IntersectionMatcherTests(unittest.'
|
|
525
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir/z'])
|
|
525
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir/z'])
|
|
526
|
im = matchmod.intersectmatchers(m1, m2)
|
|
526
|
im = matchmod.intersectmatchers(m1, m2)
|
|
527
|
# OPT: these next two could probably be set() as well.
|
|
527
|
# OPT: these next two could probably be set() as well.
|
|
528
|
self.assertEqual(im.visitchildrenset(b'.'), {b'dir'})
|
|
528
|
self.assertEqual(im.visitchildrenset(b''), {b'dir'})
|
|
529
|
self.assertEqual(im.visitchildrenset(b'dir'), {b'subdir'})
|
|
529
|
self.assertEqual(im.visitchildrenset(b'dir'), {b'subdir'})
|
|
530
|
self.assertEqual(im.visitchildrenset(b'dir/subdir'), set())
|
|
530
|
self.assertEqual(im.visitchildrenset(b'dir/subdir'), set())
|
|
531
|
self.assertEqual(im.visitchildrenset(b'dir/foo'), set())
|
|
531
|
self.assertEqual(im.visitchildrenset(b'dir/foo'), set())
|
|
@@
-540,7
+540,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
540
|
m2 = matchmod.alwaysmatcher()
|
|
540
|
m2 = matchmod.alwaysmatcher()
|
|
541
|
um = matchmod.unionmatcher([m1, m2])
|
|
541
|
um = matchmod.unionmatcher([m1, m2])
|
|
542
|
# um should be equivalent to a alwaysmatcher.
|
|
542
|
# um should be equivalent to a alwaysmatcher.
|
|
543
|
self.assertEqual(um.visitdir(b'.'), b'all')
|
|
543
|
self.assertEqual(um.visitdir(b''), b'all')
|
|
544
|
self.assertEqual(um.visitdir(b'dir'), b'all')
|
|
544
|
self.assertEqual(um.visitdir(b'dir'), b'all')
|
|
545
|
self.assertEqual(um.visitdir(b'dir/subdir'), b'all')
|
|
545
|
self.assertEqual(um.visitdir(b'dir/subdir'), b'all')
|
|
546
|
self.assertEqual(um.visitdir(b'dir/subdir/z'), b'all')
|
|
546
|
self.assertEqual(um.visitdir(b'dir/subdir/z'), b'all')
|
|
@@
-553,7
+553,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
553
|
m2 = matchmod.alwaysmatcher()
|
|
553
|
m2 = matchmod.alwaysmatcher()
|
|
554
|
um = matchmod.unionmatcher([m1, m2])
|
|
554
|
um = matchmod.unionmatcher([m1, m2])
|
|
555
|
# um should be equivalent to a alwaysmatcher.
|
|
555
|
# um should be equivalent to a alwaysmatcher.
|
|
556
|
self.assertEqual(um.visitchildrenset(b'.'), b'all')
|
|
556
|
self.assertEqual(um.visitchildrenset(b''), b'all')
|
|
557
|
self.assertEqual(um.visitchildrenset(b'dir'), b'all')
|
|
557
|
self.assertEqual(um.visitchildrenset(b'dir'), b'all')
|
|
558
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), b'all')
|
|
558
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), b'all')
|
|
559
|
self.assertEqual(um.visitchildrenset(b'dir/subdir/z'), b'all')
|
|
559
|
self.assertEqual(um.visitchildrenset(b'dir/subdir/z'), b'all')
|
|
@@
-566,7
+566,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
566
|
m2 = matchmod.alwaysmatcher()
|
|
566
|
m2 = matchmod.alwaysmatcher()
|
|
567
|
um = matchmod.unionmatcher([m1, m2])
|
|
567
|
um = matchmod.unionmatcher([m1, m2])
|
|
568
|
# um should be equivalent to a alwaysmatcher.
|
|
568
|
# um should be equivalent to a alwaysmatcher.
|
|
569
|
self.assertEqual(um.visitdir(b'.'), b'all')
|
|
569
|
self.assertEqual(um.visitdir(b''), b'all')
|
|
570
|
self.assertEqual(um.visitdir(b'dir'), b'all')
|
|
570
|
self.assertEqual(um.visitdir(b'dir'), b'all')
|
|
571
|
self.assertEqual(um.visitdir(b'dir/subdir'), b'all')
|
|
571
|
self.assertEqual(um.visitdir(b'dir/subdir'), b'all')
|
|
572
|
self.assertEqual(um.visitdir(b'dir/subdir/z'), b'all')
|
|
572
|
self.assertEqual(um.visitdir(b'dir/subdir/z'), b'all')
|
|
@@
-579,7
+579,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
579
|
m2 = matchmod.alwaysmatcher()
|
|
579
|
m2 = matchmod.alwaysmatcher()
|
|
580
|
um = matchmod.unionmatcher([m1, m2])
|
|
580
|
um = matchmod.unionmatcher([m1, m2])
|
|
581
|
# um should be equivalent to a alwaysmatcher.
|
|
581
|
# um should be equivalent to a alwaysmatcher.
|
|
582
|
self.assertEqual(um.visitchildrenset(b'.'), b'all')
|
|
582
|
self.assertEqual(um.visitchildrenset(b''), b'all')
|
|
583
|
self.assertEqual(um.visitchildrenset(b'dir'), b'all')
|
|
583
|
self.assertEqual(um.visitchildrenset(b'dir'), b'all')
|
|
584
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), b'all')
|
|
584
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), b'all')
|
|
585
|
self.assertEqual(um.visitchildrenset(b'dir/subdir/z'), b'all')
|
|
585
|
self.assertEqual(um.visitchildrenset(b'dir/subdir/z'), b'all')
|
|
@@
-592,7
+592,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
592
|
m2 = matchmod.nevermatcher()
|
|
592
|
m2 = matchmod.nevermatcher()
|
|
593
|
um = matchmod.unionmatcher([m1, m2])
|
|
593
|
um = matchmod.unionmatcher([m1, m2])
|
|
594
|
# um should be equivalent to a alwaysmatcher.
|
|
594
|
# um should be equivalent to a alwaysmatcher.
|
|
595
|
self.assertEqual(um.visitdir(b'.'), b'all')
|
|
595
|
self.assertEqual(um.visitdir(b''), b'all')
|
|
596
|
self.assertEqual(um.visitdir(b'dir'), b'all')
|
|
596
|
self.assertEqual(um.visitdir(b'dir'), b'all')
|
|
597
|
self.assertEqual(um.visitdir(b'dir/subdir'), b'all')
|
|
597
|
self.assertEqual(um.visitdir(b'dir/subdir'), b'all')
|
|
598
|
self.assertEqual(um.visitdir(b'dir/subdir/z'), b'all')
|
|
598
|
self.assertEqual(um.visitdir(b'dir/subdir/z'), b'all')
|
|
@@
-605,7
+605,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
605
|
m2 = matchmod.nevermatcher()
|
|
605
|
m2 = matchmod.nevermatcher()
|
|
606
|
um = matchmod.unionmatcher([m1, m2])
|
|
606
|
um = matchmod.unionmatcher([m1, m2])
|
|
607
|
# um should be equivalent to a alwaysmatcher.
|
|
607
|
# um should be equivalent to a alwaysmatcher.
|
|
608
|
self.assertEqual(um.visitchildrenset(b'.'), b'all')
|
|
608
|
self.assertEqual(um.visitchildrenset(b''), b'all')
|
|
609
|
self.assertEqual(um.visitchildrenset(b'dir'), b'all')
|
|
609
|
self.assertEqual(um.visitchildrenset(b'dir'), b'all')
|
|
610
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), b'all')
|
|
610
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), b'all')
|
|
611
|
self.assertEqual(um.visitchildrenset(b'dir/subdir/z'), b'all')
|
|
611
|
self.assertEqual(um.visitchildrenset(b'dir/subdir/z'), b'all')
|
|
@@
-617,7
+617,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
617
|
m1 = matchmod.alwaysmatcher()
|
|
617
|
m1 = matchmod.alwaysmatcher()
|
|
618
|
m2 = matchmod.match(b'', b'', patterns=[b'path:dir/subdir'])
|
|
618
|
m2 = matchmod.match(b'', b'', patterns=[b'path:dir/subdir'])
|
|
619
|
um = matchmod.unionmatcher([m1, m2])
|
|
619
|
um = matchmod.unionmatcher([m1, m2])
|
|
620
|
self.assertEqual(um.visitdir(b'.'), b'all')
|
|
620
|
self.assertEqual(um.visitdir(b''), b'all')
|
|
621
|
self.assertEqual(um.visitdir(b'dir'), b'all')
|
|
621
|
self.assertEqual(um.visitdir(b'dir'), b'all')
|
|
622
|
self.assertEqual(um.visitdir(b'dir/subdir'), b'all')
|
|
622
|
self.assertEqual(um.visitdir(b'dir/subdir'), b'all')
|
|
623
|
self.assertEqual(um.visitdir(b'dir/foo'), b'all')
|
|
623
|
self.assertEqual(um.visitdir(b'dir/foo'), b'all')
|
|
@@
-629,7
+629,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
629
|
m1 = matchmod.alwaysmatcher()
|
|
629
|
m1 = matchmod.alwaysmatcher()
|
|
630
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
630
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
631
|
um = matchmod.unionmatcher([m1, m2])
|
|
631
|
um = matchmod.unionmatcher([m1, m2])
|
|
632
|
self.assertEqual(um.visitchildrenset(b'.'), b'all')
|
|
632
|
self.assertEqual(um.visitchildrenset(b''), b'all')
|
|
633
|
self.assertEqual(um.visitchildrenset(b'dir'), b'all')
|
|
633
|
self.assertEqual(um.visitchildrenset(b'dir'), b'all')
|
|
634
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), b'all')
|
|
634
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), b'all')
|
|
635
|
self.assertEqual(um.visitchildrenset(b'dir/foo'), b'all')
|
|
635
|
self.assertEqual(um.visitchildrenset(b'dir/foo'), b'all')
|
|
@@
-643,7
+643,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
643
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
643
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
644
|
m2 = matchmod.match(b'', b'', include=[b'rootfilesin:dir'])
|
|
644
|
m2 = matchmod.match(b'', b'', include=[b'rootfilesin:dir'])
|
|
645
|
um = matchmod.unionmatcher([m1, m2])
|
|
645
|
um = matchmod.unionmatcher([m1, m2])
|
|
646
|
self.assertEqual(um.visitdir(b'.'), True)
|
|
646
|
self.assertEqual(um.visitdir(b''), True)
|
|
647
|
self.assertEqual(um.visitdir(b'dir'), True)
|
|
647
|
self.assertEqual(um.visitdir(b'dir'), True)
|
|
648
|
self.assertEqual(um.visitdir(b'dir/subdir'), b'all')
|
|
648
|
self.assertEqual(um.visitdir(b'dir/subdir'), b'all')
|
|
649
|
self.assertFalse(um.visitdir(b'dir/foo'))
|
|
649
|
self.assertFalse(um.visitdir(b'dir/foo'))
|
|
@@
-656,7
+656,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
656
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
656
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
657
|
m2 = matchmod.match(b'', b'', include=[b'rootfilesin:dir'])
|
|
657
|
m2 = matchmod.match(b'', b'', include=[b'rootfilesin:dir'])
|
|
658
|
um = matchmod.unionmatcher([m1, m2])
|
|
658
|
um = matchmod.unionmatcher([m1, m2])
|
|
659
|
self.assertEqual(um.visitchildrenset(b'.'), {b'dir'})
|
|
659
|
self.assertEqual(um.visitchildrenset(b''), {b'dir'})
|
|
660
|
self.assertEqual(um.visitchildrenset(b'dir'), b'this')
|
|
660
|
self.assertEqual(um.visitchildrenset(b'dir'), b'this')
|
|
661
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), b'all')
|
|
661
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), b'all')
|
|
662
|
self.assertEqual(um.visitchildrenset(b'dir/foo'), set())
|
|
662
|
self.assertEqual(um.visitchildrenset(b'dir/foo'), set())
|
|
@@
-671,7
+671,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
671
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
671
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
672
|
m2 = matchmod.match(b'', b'', include=[b'path:folder'])
|
|
672
|
m2 = matchmod.match(b'', b'', include=[b'path:folder'])
|
|
673
|
um = matchmod.unionmatcher([m1, m2])
|
|
673
|
um = matchmod.unionmatcher([m1, m2])
|
|
674
|
self.assertEqual(um.visitdir(b'.'), True)
|
|
674
|
self.assertEqual(um.visitdir(b''), True)
|
|
675
|
self.assertEqual(um.visitdir(b'dir'), True)
|
|
675
|
self.assertEqual(um.visitdir(b'dir'), True)
|
|
676
|
self.assertEqual(um.visitdir(b'dir/subdir'), b'all')
|
|
676
|
self.assertEqual(um.visitdir(b'dir/subdir'), b'all')
|
|
677
|
self.assertFalse(um.visitdir(b'dir/foo'))
|
|
677
|
self.assertFalse(um.visitdir(b'dir/foo'))
|
|
@@
-684,7
+684,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
684
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
684
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
685
|
m2 = matchmod.match(b'', b'', include=[b'path:folder'])
|
|
685
|
m2 = matchmod.match(b'', b'', include=[b'path:folder'])
|
|
686
|
um = matchmod.unionmatcher([m1, m2])
|
|
686
|
um = matchmod.unionmatcher([m1, m2])
|
|
687
|
self.assertEqual(um.visitchildrenset(b'.'), {b'folder', b'dir'})
|
|
687
|
self.assertEqual(um.visitchildrenset(b''), {b'folder', b'dir'})
|
|
688
|
self.assertEqual(um.visitchildrenset(b'dir'), {b'subdir'})
|
|
688
|
self.assertEqual(um.visitchildrenset(b'dir'), {b'subdir'})
|
|
689
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), b'all')
|
|
689
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), b'all')
|
|
690
|
self.assertEqual(um.visitchildrenset(b'dir/foo'), set())
|
|
690
|
self.assertEqual(um.visitchildrenset(b'dir/foo'), set())
|
|
@@
-699,7
+699,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
699
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir/x'])
|
|
699
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir/x'])
|
|
700
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
700
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
701
|
um = matchmod.unionmatcher([m1, m2])
|
|
701
|
um = matchmod.unionmatcher([m1, m2])
|
|
702
|
self.assertEqual(um.visitdir(b'.'), True)
|
|
702
|
self.assertEqual(um.visitdir(b''), True)
|
|
703
|
self.assertEqual(um.visitdir(b'dir'), True)
|
|
703
|
self.assertEqual(um.visitdir(b'dir'), True)
|
|
704
|
self.assertEqual(um.visitdir(b'dir/subdir'), b'all')
|
|
704
|
self.assertEqual(um.visitdir(b'dir/subdir'), b'all')
|
|
705
|
self.assertFalse(um.visitdir(b'dir/foo'))
|
|
705
|
self.assertFalse(um.visitdir(b'dir/foo'))
|
|
@@
-712,7
+712,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
712
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir/x'])
|
|
712
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir/x'])
|
|
713
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
713
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
714
|
um = matchmod.unionmatcher([m1, m2])
|
|
714
|
um = matchmod.unionmatcher([m1, m2])
|
|
715
|
self.assertEqual(um.visitchildrenset(b'.'), {b'dir'})
|
|
715
|
self.assertEqual(um.visitchildrenset(b''), {b'dir'})
|
|
716
|
self.assertEqual(um.visitchildrenset(b'dir'), {b'subdir'})
|
|
716
|
self.assertEqual(um.visitchildrenset(b'dir'), {b'subdir'})
|
|
717
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), b'all')
|
|
717
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), b'all')
|
|
718
|
self.assertEqual(um.visitchildrenset(b'dir/foo'), set())
|
|
718
|
self.assertEqual(um.visitchildrenset(b'dir/foo'), set())
|
|
@@
-728,7
+728,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
728
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir/z'])
|
|
728
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir/z'])
|
|
729
|
um = matchmod.unionmatcher([m1, m2])
|
|
729
|
um = matchmod.unionmatcher([m1, m2])
|
|
730
|
# OPT: these next three could probably be False as well.
|
|
730
|
# OPT: these next three could probably be False as well.
|
|
731
|
self.assertEqual(um.visitdir(b'.'), True)
|
|
731
|
self.assertEqual(um.visitdir(b''), True)
|
|
732
|
self.assertEqual(um.visitdir(b'dir'), True)
|
|
732
|
self.assertEqual(um.visitdir(b'dir'), True)
|
|
733
|
self.assertEqual(um.visitdir(b'dir/subdir'), True)
|
|
733
|
self.assertEqual(um.visitdir(b'dir/subdir'), True)
|
|
734
|
self.assertFalse(um.visitdir(b'dir/foo'))
|
|
734
|
self.assertFalse(um.visitdir(b'dir/foo'))
|
|
@@
-740,7
+740,7
b' class UnionMatcherTests(unittest.TestCas'
|
|
740
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir/x'])
|
|
740
|
m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir/x'])
|
|
741
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir/z'])
|
|
741
|
m2 = matchmod.match(b'', b'', include=[b'path:dir/subdir/z'])
|
|
742
|
um = matchmod.unionmatcher([m1, m2])
|
|
742
|
um = matchmod.unionmatcher([m1, m2])
|
|
743
|
self.assertEqual(um.visitchildrenset(b'.'), {b'dir'})
|
|
743
|
self.assertEqual(um.visitchildrenset(b''), {b'dir'})
|
|
744
|
self.assertEqual(um.visitchildrenset(b'dir'), {b'subdir'})
|
|
744
|
self.assertEqual(um.visitchildrenset(b'dir'), {b'subdir'})
|
|
745
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), {b'x', b'z'})
|
|
745
|
self.assertEqual(um.visitchildrenset(b'dir/subdir'), {b'x', b'z'})
|
|
746
|
self.assertEqual(um.visitchildrenset(b'dir/foo'), set())
|
|
746
|
self.assertEqual(um.visitchildrenset(b'dir/foo'), set())
|
|
@@
-754,7
+754,7
b' class SubdirMatcherTests(unittest.TestCa'
|
|
754
|
m = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
754
|
m = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
755
|
sm = matchmod.subdirmatcher(b'dir', m)
|
|
755
|
sm = matchmod.subdirmatcher(b'dir', m)
|
|
756
|
|
|
756
|
|
|
757
|
self.assertEqual(sm.visitdir(b'.'), True)
|
|
757
|
self.assertEqual(sm.visitdir(b''), True)
|
|
758
|
self.assertEqual(sm.visitdir(b'subdir'), b'all')
|
|
758
|
self.assertEqual(sm.visitdir(b'subdir'), b'all')
|
|
759
|
# OPT: These next two should probably be 'all' not True.
|
|
759
|
# OPT: These next two should probably be 'all' not True.
|
|
760
|
self.assertEqual(sm.visitdir(b'subdir/x'), True)
|
|
760
|
self.assertEqual(sm.visitdir(b'subdir/x'), True)
|
|
@@
-765,7
+765,7
b' class SubdirMatcherTests(unittest.TestCa'
|
|
765
|
m = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
765
|
m = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
|
|
766
|
sm = matchmod.subdirmatcher(b'dir', m)
|
|
766
|
sm = matchmod.subdirmatcher(b'dir', m)
|
|
767
|
|
|
767
|
|
|
768
|
self.assertEqual(sm.visitchildrenset(b'.'), {b'subdir'})
|
|
768
|
self.assertEqual(sm.visitchildrenset(b''), {b'subdir'})
|
|
769
|
self.assertEqual(sm.visitchildrenset(b'subdir'), b'all')
|
|
769
|
self.assertEqual(sm.visitchildrenset(b'subdir'), b'all')
|
|
770
|
# OPT: These next two should probably be 'all' not 'this'.
|
|
770
|
# OPT: These next two should probably be 'all' not 'this'.
|
|
771
|
self.assertEqual(sm.visitchildrenset(b'subdir/x'), b'this')
|
|
771
|
self.assertEqual(sm.visitchildrenset(b'subdir/x'), b'this')
|
|
@@
-795,12
+795,12
b' class PrefixdirMatcherTests(unittest.Tes'
|
|
795
|
self.assertEqual(bool(pm(b'd/e/b.txt')), False)
|
|
795
|
self.assertEqual(bool(pm(b'd/e/b.txt')), False)
|
|
796
|
self.assertEqual(bool(pm(b'd/e/f/b.txt')), True)
|
|
796
|
self.assertEqual(bool(pm(b'd/e/f/b.txt')), True)
|
|
797
|
|
|
797
|
|
|
798
|
self.assertEqual(m.visitdir(b'.'), True)
|
|
798
|
self.assertEqual(m.visitdir(b''), True)
|
|
799
|
self.assertEqual(m.visitdir(b'e'), True)
|
|
799
|
self.assertEqual(m.visitdir(b'e'), True)
|
|
800
|
self.assertEqual(m.visitdir(b'e/f'), True)
|
|
800
|
self.assertEqual(m.visitdir(b'e/f'), True)
|
|
801
|
self.assertEqual(m.visitdir(b'e/f/g'), False)
|
|
801
|
self.assertEqual(m.visitdir(b'e/f/g'), False)
|
|
802
|
|
|
802
|
|
|
803
|
self.assertEqual(pm.visitdir(b'.'), True)
|
|
803
|
self.assertEqual(pm.visitdir(b''), True)
|
|
804
|
self.assertEqual(pm.visitdir(b'd'), True)
|
|
804
|
self.assertEqual(pm.visitdir(b'd'), True)
|
|
805
|
self.assertEqual(pm.visitdir(b'd/e'), True)
|
|
805
|
self.assertEqual(pm.visitdir(b'd/e'), True)
|
|
806
|
self.assertEqual(pm.visitdir(b'd/e/f'), True)
|
|
806
|
self.assertEqual(pm.visitdir(b'd/e/f'), True)
|
|
@@
-814,7
+814,7
b' class PrefixdirMatcherTests(unittest.Tes'
|
|
814
|
# OPT: visitchildrenset could possibly return {'e'} and {'f'} for these
|
|
814
|
# OPT: visitchildrenset could possibly return {'e'} and {'f'} for these
|
|
815
|
# next two, respectively; patternmatcher does not have this
|
|
815
|
# next two, respectively; patternmatcher does not have this
|
|
816
|
# optimization.
|
|
816
|
# optimization.
|
|
817
|
self.assertEqual(m.visitchildrenset(b'.'), b'this')
|
|
817
|
self.assertEqual(m.visitchildrenset(b''), b'this')
|
|
818
|
self.assertEqual(m.visitchildrenset(b'e'), b'this')
|
|
818
|
self.assertEqual(m.visitchildrenset(b'e'), b'this')
|
|
819
|
self.assertEqual(m.visitchildrenset(b'e/f'), b'this')
|
|
819
|
self.assertEqual(m.visitchildrenset(b'e/f'), b'this')
|
|
820
|
self.assertEqual(m.visitchildrenset(b'e/f/g'), set())
|
|
820
|
self.assertEqual(m.visitchildrenset(b'e/f/g'), set())
|
|
@@
-822,7
+822,7
b' class PrefixdirMatcherTests(unittest.Tes'
|
|
822
|
# OPT: visitchildrenset could possibly return {'d'}, {'e'}, and {'f'}
|
|
822
|
# OPT: visitchildrenset could possibly return {'d'}, {'e'}, and {'f'}
|
|
823
|
# for these next three, respectively; patternmatcher does not have this
|
|
823
|
# for these next three, respectively; patternmatcher does not have this
|
|
824
|
# optimization.
|
|
824
|
# optimization.
|
|
825
|
self.assertEqual(pm.visitchildrenset(b'.'), b'this')
|
|
825
|
self.assertEqual(pm.visitchildrenset(b''), b'this')
|
|
826
|
self.assertEqual(pm.visitchildrenset(b'd'), b'this')
|
|
826
|
self.assertEqual(pm.visitchildrenset(b'd'), b'this')
|
|
827
|
self.assertEqual(pm.visitchildrenset(b'd/e'), b'this')
|
|
827
|
self.assertEqual(pm.visitchildrenset(b'd/e'), b'this')
|
|
828
|
self.assertEqual(pm.visitchildrenset(b'd/e/f'), b'this')
|
|
828
|
self.assertEqual(pm.visitchildrenset(b'd/e/f'), b'this')
|