~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lazy_regex.py

  • Committer: John Arbash Meinel
  • Date: 2010-02-17 17:11:16 UTC
  • mfrom: (4797.2.17 2.1)
  • mto: (4797.2.18 2.1)
  • mto: This revision was merged to the branch mainline in revision 5055.
  • Revision ID: john@arbash-meinel.com-20100217171116-h7t9223ystbnx5h8
merge bzr.2.1 in preparation for NEWS entry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import re
20
20
 
21
 
from bzrlib import errors
22
21
from bzrlib import (
23
22
    lazy_regex,
24
23
    tests,
64
63
                          ('_real_re_compile', ('foo',), {}),
65
64
                         ], actions)
66
65
 
67
 
    def test_bad_pattern(self):
68
 
        """Ensure lazy regex handles bad patterns cleanly."""
69
 
        p = lazy_regex.lazy_compile('RE:[')
70
 
        # As p.match is lazy, we make it into a lambda so its handled
71
 
        # by assertRaises correctly.
72
 
        e = self.assertRaises(errors.InvalidPattern, lambda: p.match('foo'))
73
 
        self.assertEqual(e.msg, '"RE:[" unexpected end of regular expression')
74
 
 
75
66
 
76
67
class TestLazyCompile(tests.TestCase):
77
68