~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: 2007-03-06 15:25:11 UTC
  • mfrom: (2319.1.1 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070306152511-aa137bb63d6e3a62
(Kent Gibson) Normalize ignore patterns to avoid problems with path seperators.

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
            (u'[a-z]',
115
115
             [u'a', u'q', u'f'],
116
116
             [u'A', u'Q', u'F']),
117
 
            (ur'[^a-z]',
 
117
            (u'[^a-z]',
118
118
             [u'A', u'Q', u'F'],
119
119
             [u'a', u'q', u'f']),
120
120
            (u'[!a-z]foo',
121
121
             [u'Afoo', u'.foo'],
122
122
             [u'afoo', u'ABfoo']),
123
 
            (ur'foo[!a-z]bar',
 
123
            (u'foo[!a-z]bar',
124
124
             [u'fooAbar', u'foo.bar'],
125
125
             [u'foojbar']),
126
 
            (ur'[\x20-\x30\u8336]',
 
126
            (u'[\x20-\x30\u8336]',
127
127
             [u'\040', u'\044', u'\u8336'],
128
128
             [u'\x1f']),
129
 
            (ur'[^\x20-\x30\u8336]',
 
129
            (u'[^\x20-\x30\u8336]',
130
130
             [u'\x1f'],
131
131
             [u'\040', u'\044', u'\u8336']),
132
132
            ])
133
133
 
134
134
    def test_regex(self):
135
135
        self.assertMatch([
136
 
            (ur'RE:(a|b|c+)',
137
 
             [u'a', u'b', u'ccc'],
138
 
             [u'd', u'aa', u'c+', u'-a']),
139
 
            (ur'RE:(?:a|b|c+)',
140
 
             [u'a', u'b', u'ccc'],
141
 
             [u'd', u'aa', u'c+', u'-a']),
142
 
            (ur'RE:(?P<a>.)(?P=a)',
 
136
            (u'RE:(a|b|c+)',
 
137
             [u'a', u'b', u'ccc'],
 
138
             [u'd', u'aa', u'c+', u'-a']),
 
139
            (u'RE:(?:a|b|c+)',
 
140
             [u'a', u'b', u'ccc'],
 
141
             [u'd', u'aa', u'c+', u'-a']),
 
142
            (u'RE:(?P<a>.)(?P=a)',
143
143
             [u'a'],
144
144
             [u'ab', u'aa', u'aaa']),
 
145
            # test we can handle odd numbers of trailing backslashes
 
146
            (u'RE:a\\\\\\',
 
147
             [u'a\\'],
 
148
             [u'a', u'ab', u'aa', u'aaa']),
145
149
            ])
146
150
 
147
151
    def test_question_mark(self):
226
230
             [u'foo/bar', u'foo/.bar', u'x/foo/y']),
227
231
            ])
228
232
 
 
233
    def test_backslash(self):
 
234
        self.assertMatch([
 
235
            (u'.\\foo',
 
236
             [u'foo'],
 
237
             [u'\u8336/foo', u'barfoo', u'x/y/foo']),
 
238
            (u'.\\f*',
 
239
             [u'foo'],
 
240
             [u'foo/bar', u'foo/.bar', u'x/foo/y']),
 
241
            (u'foo\\**\\x',
 
242
             [u'foo/x', u'foo/bar/x'],
 
243
             [u'foox', u'foo/bax', u'foo/.x', u'foo/bar/bax']),
 
244
            ])
 
245
 
 
246
    def test_trailing_slash(self):
 
247
        self.assertMatch([
 
248
            (u'./foo/',
 
249
             [u'foo'],
 
250
             [u'\u8336/foo', u'barfoo', u'x/y/foo']),
 
251
            (u'.\\foo\\',
 
252
             [u'foo'],
 
253
             [u'foo/', u'\u8336/foo', u'barfoo', u'x/y/foo']),
 
254
            ])
 
255
 
229
256
    def test_leading_asterisk_dot(self):
230
257
        self.assertMatch([
231
258
            (u'*.x',