~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_globbing.py

  • Committer: Andrew Bennetts
  • Date: 2010-07-29 11:17:57 UTC
  • mfrom: (5050.3.17 2.2)
  • mto: This revision was merged to the branch mainline in revision 5365.
  • Revision ID: andrew.bennetts@canonical.com-20100729111757-018h3pcefo7z0dnq
Merge lp:bzr/2.2 into lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
 
18
import re
 
19
 
18
20
from bzrlib import errors
19
21
from bzrlib.globbing import (
20
22
    Globster,
311
313
 
312
314
    def test_bad_pattern(self):
313
315
        """Ensure that globster handles bad patterns cleanly."""
314
 
        patterns = [u'RE:[']
 
316
        patterns = [u'RE:[', u'/home/foo', u'RE:*.cpp']
315
317
        g = Globster(patterns)
316
 
        e = self.assertRaises(errors.InvalidPattern, g.match, 'foo')
317
 
        self.assertContainsRe(e.msg, "File.*ignore.*contains errors")
 
318
        e = self.assertRaises(errors.InvalidPattern, g.match, 'filename')
 
319
        self.assertContainsRe(e.msg,
 
320
            "File.*ignore.*contains error.*RE:\[.*RE:\*\.cpp", flags=re.DOTALL)
318
321
 
319
322
 
320
323
class TestExceptionGlobster(TestCase):