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

merge bzr.dev r3564

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,
20
21
    )
21
22
from bzrlib.tests import (
22
23
    TestCase, 
305
306
            self.assertEqual(patterns[x],globster.match(filename))
306
307
        self.assertEqual(None,globster.match('foobar.300'))
307
308
 
 
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'))