~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_globbing.py

  • Committer: Patch Queue Manager
  • Date: 2011-10-14 16:54:26 UTC
  • mfrom: (6216.1.1 remove-this-file)
  • Revision ID: pqm@pqm.ubuntu.com-20111014165426-tjix4e6idryf1r2z
(jelmer) Remove an accidentally committed .THIS file. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2011 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,
30
29
    )
31
30
 
32
31
 
38
37
                glob = glob_prefix + glob
39
38
            globster = Globster([glob])
40
39
            for name in positive:
41
 
                self.failUnless(globster.match(name), repr(
 
40
                self.assertTrue(globster.match(name), repr(
42
41
                    u'name "%s" does not match glob "%s" (re=%s)' %
43
42
                    (name, glob, globster._regex_patterns[0][0].pattern)))
44
43
            for name in negative:
45
 
                self.failIf(globster.match(name), repr(
 
44
                self.assertFalse(globster.match(name), repr(
46
45
                    u'name "%s" does match glob "%s" (re=%s)' %
47
46
                    (name, glob, globster._regex_patterns[0][0].pattern)))
48
47
 
55
54
    def test_char_group_digit(self):
56
55
        self.assertMatchBasenameAndFullpath([
57
56
            # The definition of digit this uses includes arabic digits from
58
 
            # non-latin scripts (arabic, indic, etc.) and subscript/superscript
59
 
            # digits, but neither roman numerals nor vulgar fractions.
 
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>
60
61
            (u'[[:digit:]]',
61
 
             [u'0', u'5', u'\u0663', u'\u06f9', u'\u0f21', u'\xb9'],
 
62
             [u'0', u'5', u'\u0663', u'\u06f9', u'\u0f21'],
62
63
             [u'T', u'q', u' ', u'\u8336', u'.']),
63
64
            (u'[^[:digit:]]',
64
65
             [u'T', u'q', u' ', u'\u8336', u'.'],
65
 
             [u'0', u'5', u'\u0663', u'\u06f9', u'\u0f21', u'\xb9']),
 
66
             [u'0', u'5', u'\u0663', u'\u06f9', u'\u0f21']),
66
67
            ])
67
68
 
68
69
    def test_char_group_space(self):