@@ -31,6 +31,7 @@ def setUp(self):
3131 self .mktemp ('.bb' , 'H' )
3232 self .mktemp ('aaa' , 'zzzF' )
3333 self .mktemp ('ZZZ' )
34+ self .mktemp ('EF' )
3435 self .mktemp ('a' , 'bcd' , 'EF' )
3536 self .mktemp ('a' , 'bcd' , 'efg' , 'ha' )
3637 if can_symlink ():
@@ -200,7 +201,7 @@ def rglob(self, *parts, **kwargs):
200201
201202 def test_recursive_glob (self ):
202203 eq = self .assertSequencesEqual_noorder
203- full = [('ZZZ' ,),
204+ full = [('EF' ,), ( ' ZZZ' ,),
204205 ('a' ,), ('a' , 'D' ),
205206 ('a' , 'bcd' ),
206207 ('a' , 'bcd' , 'EF' ),
@@ -217,8 +218,8 @@ def test_recursive_glob(self):
217218 ('sym3' , 'efg' , 'ha' ),
218219 ]
219220 eq (self .rglob ('**' ), self .joins (('' ,), * full ))
220- eq (self .rglob ('.' , '**' ), self . joins (( '.' , ' ' ),
221- * (( '.' ,) + i for i in full )))
221+ eq (self .rglob (os . curdir , '**' ),
222+ self . joins (( os . curdir , '' ), * (( os . curdir ,) + i for i in full )))
222223 dirs = [('a' , '' ), ('a' , 'bcd' , '' ), ('a' , 'bcd' , 'efg' , '' ),
223224 ('aaa' , '' ), ('aab' , '' )]
224225 if can_symlink ():
@@ -229,11 +230,11 @@ def test_recursive_glob(self):
229230 ('a' , '' ), ('a' , 'D' ), ('a' , 'bcd' ), ('a' , 'bcd' , 'EF' ),
230231 ('a' , 'bcd' , 'efg' ), ('a' , 'bcd' , 'efg' , 'ha' )))
231232 eq (self .rglob ('a**' ), self .joins (('a' ,), ('aaa' ,), ('aab' ,)))
232- expect = [('a' , 'bcd' , 'EF' )]
233+ expect = [('a' , 'bcd' , 'EF' ), ( 'EF' ,) ]
233234 if can_symlink ():
234235 expect += [('sym3' , 'EF' )]
235236 eq (self .rglob ('**' , 'EF' ), self .joins (* expect ))
236- expect = [('a' , 'bcd' , 'EF' ), ('aaa' , 'zzzF' ), ('aab' , 'F' )]
237+ expect = [('a' , 'bcd' , 'EF' ), ('aaa' , 'zzzF' ), ('aab' , 'F' ), ( 'EF' ,) ]
237238 if can_symlink ():
238239 expect += [('sym3' , 'EF' )]
239240 eq (self .rglob ('**' , '*F' ), self .joins (* expect ))
@@ -247,10 +248,18 @@ def test_recursive_glob(self):
247248 eq (glob .glob ('**' , recursive = True ), [join (* i ) for i in full ])
248249 eq (glob .glob (join ('**' , '' ), recursive = True ),
249250 [join (* i ) for i in dirs ])
251+ eq (glob .glob (join ('**' , '*' ), recursive = True ),
252+ [join (* i ) for i in full ])
253+ eq (glob .glob (join (os .curdir , '**' ), recursive = True ),
254+ [join (os .curdir , '' )] + [join (os .curdir , * i ) for i in full ])
255+ eq (glob .glob (join (os .curdir , '**' , '' ), recursive = True ),
256+ [join (os .curdir , '' )] + [join (os .curdir , * i ) for i in dirs ])
257+ eq (glob .glob (join (os .curdir , '**' , '*' ), recursive = True ),
258+ [join (os .curdir , * i ) for i in full ])
250259 eq (glob .glob (join ('**' ,'zz*F' ), recursive = True ),
251260 [join ('aaa' , 'zzzF' )])
252261 eq (glob .glob ('**zz*F' , recursive = True ), [])
253- expect = [join ('a' , 'bcd' , 'EF' )]
262+ expect = [join ('a' , 'bcd' , 'EF' ), 'EF' ]
254263 if can_symlink ():
255264 expect += [join ('sym3' , 'EF' )]
256265 eq (glob .glob (join ('**' , 'EF' ), recursive = True ), expect )
0 commit comments