def test_EscapeEscapeEscape(self): "Test escape escape escape glob" r = q.makeRe(r'foo\\\tbar') assert r.search(r'foo\tbar') assert not r.search('fooxbar') assert not r.search('foobar')
def test_EscapeOther(self): "Test escape anything glob" r = q.makeRe(r'foo\tbar') assert r.search(r'footbar') assert not r.search('fooxbar') assert not r.search('foobar')
def test_EscapeQuestion(self): "Test escape question glob" r = q.makeRe(r'foo\?bar') assert r.search('foo?bar') assert not r.search('fooxbar') assert not r.search('foobar')
def test_EscapeAst(self): "Test escape asterisk glob" r = q.makeRe(r'foo\*bar') assert r.search('foo*bar') assert not r.search('fooxbar') assert not r.search('foobar')
def test_Question(self): "Test question glob" r = q.makeRe('foo?bar') assert r.search('foombar') assert not r.search('fooxmbar') assert not r.search('foobar')
def test_asteriskLA(self): "Test asterisk left anchored glob" r = q.makeRe('foo*') assert r.search('foobar') assert r.search('foofoo') assert r.search('foo') assert not r.search('foxo') assert not r.search('barfoo')
def test_asteriskBoth(self): "Test asterisk none anchored glob" r = q.makeRe('*foo*') assert r.search('foobar') assert r.search('foofoo') assert r.search('foo') assert not r.search('foxo') assert r.search('barfoo')
def test_asteriskMiddle(self): "Test asterisk both anchored glob" r = q.makeRe('foo*bar') assert r.search('foobar') assert not r.search('foofoo') assert not r.search('foo') assert not r.search('foxo') assert not r.search('barfoo') assert r.search('foomoobar') assert not r.search('ofofoomoobar') assert not r.search('foomoobarofo')