Ejemplo n.º 1
0
    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')
Ejemplo n.º 2
0
    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')
Ejemplo n.º 3
0
    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')
Ejemplo n.º 4
0
    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')
Ejemplo n.º 5
0
    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')
Ejemplo n.º 6
0
    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')
Ejemplo n.º 7
0
    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')
Ejemplo n.º 8
0
    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')