~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_globbing.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-06-05 04:05:05 UTC
  • mfrom: (3473.1.1 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080605040505-i9kqxg2fps2qjdi0
Add the 'alias' command (Tim Penhey)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
from bzrlib.globbing import (
19
19
    Globster,
20
 
    _OrderedGlobster,
21
20
    )
22
21
from bzrlib.tests import (
23
22
    TestCase, 
306
305
            self.assertEqual(patterns[x],globster.match(filename))
307
306
        self.assertEqual(None,globster.match('foobar.300'))
308
307
 
309
 
 
310
 
class TestOrderedGlobster(TestCase):
311
 
 
312
 
    def test_ordered_globs(self):
313
 
        """test that the first match in a list is the one found"""
314
 
        patterns = [ u'*.foo', u'bar.*']
315
 
        globster = _OrderedGlobster(patterns)
316
 
        self.assertEqual(u'*.foo', globster.match('bar.foo'))
317
 
        self.assertEqual(None, globster.match('foo.bar'))
318
 
        globster = _OrderedGlobster(reversed(patterns))
319
 
        self.assertEqual(u'bar.*', globster.match('bar.foo'))
320
 
        self.assertEqual(None, globster.match('foo.bar'))