/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_globbing.py

  • Committer: Kent Gibson
  • Date: 2007-03-01 08:46:00 UTC
  • mto: (2319.1.1 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 2320.
  • Revision ID: warthog618@gmail.com-20070301084600-mce8y9te2o548h5r
Normalise ignore patterns to use '/' path separator.
Also fixes bug 86451 where a trailing '\' crashes pattern matching.
Added detection and correction of trailing '\' in ignore REs that would
escape the closing bracket.

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
            (ur'RE:(?P<a>.)(?P=a)',
143
143
             [u'a'],
144
144
             [u'ab', u'aa', u'aaa']),
 
145
            # test we can handle odd numbers of trailing backslashes
 
146
            (u'RE:a\\\\\\',
 
147
             [u'a\\'],
 
148
             [u'a', u'ab', u'aa', u'aaa']),
145
149
            ])
146
150
 
147
151
    def test_question_mark(self):
226
230
             [u'foo/bar', u'foo/.bar', u'x/foo/y']),
227
231
            ])
228
232
 
 
233
    def test_backslash(self):
 
234
        self.assertMatch([
 
235
            (u'.\\foo',
 
236
             [u'foo'],
 
237
             [u'\u8336/foo', u'barfoo', u'x/y/foo']),
 
238
            (u'.\\f*',
 
239
             [u'foo'],
 
240
             [u'foo/bar', u'foo/.bar', u'x/foo/y']),
 
241
            (u'foo\\**\\x',
 
242
             [u'foo/x', u'foo/bar/x'],
 
243
             [u'foox', u'foo/bax', u'foo/.x', u'foo/bar/bax']),
 
244
            ])
 
245
 
 
246
    def test_trailing_slash(self):
 
247
        self.assertMatch([
 
248
            (u'./foo/',
 
249
             [u'foo'],
 
250
             [u'\u8336/foo', u'barfoo', u'x/y/foo']),
 
251
            (u'.\\foo\\',
 
252
             [u'foo'],
 
253
             [u'foo/', u'\u8336/foo', u'barfoo', u'x/y/foo']),
 
254
            ])
 
255
 
229
256
    def test_leading_asterisk_dot(self):
230
257
        self.assertMatch([
231
258
            (u'*.x',