~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_ignore.py

  • Committer: Marius Kruger
  • Date: 2010-08-15 04:52:51 UTC
  • mfrom: (5376 +trunk)
  • mto: (5384.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5385.
  • Revision ID: marius.kruger@enerweb.co.za-20100815045251-izmea8nn05thhrok
merge with bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
        tree = self.make_branch_and_tree('a')
163
163
        self.run_bzr(['ignore', '--directory=a', 'README'])
164
164
        self.check_file_contents('a/.bzrignore', 'README\n')
 
165
 
 
166
    def test_ignored_invalid_pattern(self):
 
167
        """Ensure graceful handling for invalid ignore pattern.
 
168
 
 
169
        Test case for #300062.
 
170
        Invalid pattern should show clear error message.
 
171
        Invalid pattern should not be added to .bzrignore file.
 
172
        """
 
173
        tree = self.make_branch_and_tree('.')
 
174
        out, err = self.run_bzr(['ignore', 'RE:*.cpp', 'foo', 'RE:['], 3)
 
175
        self.assertEqual(out, '')
 
176
        self.assertContainsRe(err,
 
177
            'Invalid ignore pattern.*RE:\*\.cpp.*RE:\[', re.DOTALL)
 
178
        self.assertNotContainsRe(err, 'foo', re.DOTALL)
 
179
        self.assertFalse(os.path.isfile('.bzrignore'))
 
180