/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 breezy/tests/test_globbing.py

  • Committer: Jelmer Vernooij
  • Date: 2017-10-27 00:18:42 UTC
  • mto: This revision was merged to the branch mainline in revision 6799.
  • Revision ID: jelmer@jelmer.uk-20171027001842-o77sekj0g2t2zwbn
Properly escape backslashes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
318
318
        g = Globster(patterns)
319
319
        e = self.assertRaises(lazy_regex.InvalidPattern, g.match, 'filename')
320
320
        self.assertContainsRe(e.msg,
321
 
            "File.*ignore.*contains error.*RE:\[.*RE:\*\.cpp", flags=re.DOTALL)
 
321
            r"File.*ignore.*contains error.*RE:\[.*RE:\*\.cpp", flags=re.DOTALL)
322
322
 
323
323
 
324
324
class TestExceptionGlobster(TestCase):
325
325
 
326
326
    def test_exclusion_patterns(self):
327
327
        """test that exception patterns are not matched"""
328
 
        patterns = [ u'*', u'!./local', u'!./local/**/*', u'!RE:\.z.*',u'!!./.zcompdump' ]
 
328
        patterns = [ u'*', u'!./local', u'!./local/**/*', u'!RE:\\.z.*',u'!!./.zcompdump' ]
329
329
        globster = ExceptionGlobster(patterns)
330
330
        self.assertEqual(u'*', globster.match('tmp/foo.txt'))
331
331
        self.assertEqual(None, globster.match('local'))