~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:
1
 
# Copyright (C) 2006-2011 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
# -*- coding: utf-8 -*-
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
26
26
    )
27
27
from bzrlib.tests import (
28
28
    TestCase,
 
29
    TestCaseInTempDir,
29
30
    )
30
31
 
31
32
 
37
38
                glob = glob_prefix + glob
38
39
            globster = Globster([glob])
39
40
            for name in positive:
40
 
                self.assertTrue(globster.match(name), repr(
 
41
                self.failUnless(globster.match(name), repr(
41
42
                    u'name "%s" does not match glob "%s" (re=%s)' %
42
43
                    (name, glob, globster._regex_patterns[0][0].pattern)))
43
44
            for name in negative:
44
 
                self.assertFalse(globster.match(name), repr(
 
45
                self.failIf(globster.match(name), repr(
45
46
                    u'name "%s" does match glob "%s" (re=%s)' %
46
47
                    (name, glob, globster._regex_patterns[0][0].pattern)))
47
48
 
54
55
    def test_char_group_digit(self):
55
56
        self.assertMatchBasenameAndFullpath([
56
57
            # The definition of digit this uses includes arabic digits from
57
 
            # non-latin scripts (arabic, indic, etc.) but neither roman
58
 
            # numerals nor vulgar fractions. Some characters such as
59
 
            # subscript/superscript digits may or may not match depending on
60
 
            # the Python version used, see: <http://bugs.python.org/issue6561>
 
58
            # non-latin scripts (arabic, indic, etc.) and subscript/superscript
 
59
            # digits, but neither roman numerals nor vulgar fractions.
61
60
            (u'[[:digit:]]',
62
 
             [u'0', u'5', u'\u0663', u'\u06f9', u'\u0f21'],
 
61
             [u'0', u'5', u'\u0663', u'\u06f9', u'\u0f21', u'\xb9'],
63
62
             [u'T', u'q', u' ', u'\u8336', u'.']),
64
63
            (u'[^[:digit:]]',
65
64
             [u'T', u'q', u' ', u'\u8336', u'.'],
66
 
             [u'0', u'5', u'\u0663', u'\u06f9', u'\u0f21']),
 
65
             [u'0', u'5', u'\u0663', u'\u06f9', u'\u0f21', u'\xb9']),
67
66
            ])
68
67
 
69
68
    def test_char_group_space(self):