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)))
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.
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'.']),
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']),
69
68
def test_char_group_space(self):