def test005(self): from zope.index.text.parsetree import AndNode from zope.index.text.parsetree import AtomNode from zope.index.text.parsetree import OrNode parser = self._makeOne() self._expect(parser, "aa AND bb OR cc AnD dd", OrNode([AndNode([AtomNode("aa"), AtomNode("bb")]), AndNode([AtomNode("cc"), AtomNode("dd")])]))
def test023(self): from zope.index.text.parsetree import AndNode from zope.index.text.parsetree import AtomNode from zope.index.text.parsetree import GlobNode parser = self._makeOne() self._expect(parser, "foo* bar", AndNode([GlobNode("foo*"), AtomNode("bar")]))
def test021(self): from zope.index.text.parsetree import AndNode from zope.index.text.parsetree import AtomNode parser = self._makeOne() self._expect(parser, 'foo"bar"blech', AndNode([AtomNode("foo"), AtomNode("bar"), AtomNode("blech")]))
def test016(self): from zope.index.text.parsetree import AndNode from zope.index.text.parsetree import AtomNode from zope.index.text.parsetree import NotNode parser = self._makeOne() self._expect(parser, "-foo bar", AndNode([AtomNode("bar"), NotNode(AtomNode("foo"))]))
def test008(self): from zope.index.text.parsetree import AndNode from zope.index.text.parsetree import AtomNode from zope.index.text.parsetree import NotNode parser = self._makeOne() self._expect(parser, "aa NOT bb", AndNode([AtomNode("aa"), NotNode(AtomNode("bb"))]))
def test_3_asterisks(self): from zope.index.text.parsetree import AndNode from zope.index.text.parsetree import AtomNode parser = self._makeOne() self._expect(parser, "foo *** bar", AndNode([AtomNode("foo"), AtomNode("bar")]), expected_ignored=['***'])
def test_phrase_with_only_whitespace(self): from zope.index.text.parsetree import AndNode from zope.index.text.parsetree import AtomNode parser = self._makeOne() self._expect(parser, 'foo " " bar', AndNode([AtomNode("foo"), AtomNode("bar")]), expected_ignored=['" "'])
def test_lone_quote(self): from zope.index.text.parsetree import AndNode from zope.index.text.parsetree import AtomNode parser = self._makeOne() self._expect(parser, 'foo " bar', AndNode([AtomNode("foo"), AtomNode("bar")]), expected_ignored=[])
def test_lone_question_mark(self): from zope.index.text.parsetree import AndNode from zope.index.text.parsetree import AtomNode parser = self._makeOne() self._expect(parser, "foo ? bar", AndNode([AtomNode("foo"), AtomNode("bar")]), expected_ignored=['?'])
def test006(self): from zope.index.text.parsetree import AndNode from zope.index.text.parsetree import AtomNode from zope.index.text.parsetree import OrNode parser = self._makeOne() self._expect(parser, "(aa OR bb) AND (cc OR dd)", AndNode([OrNode([AtomNode("aa"), AtomNode("bb")]), OrNode([AtomNode("cc"), AtomNode("dd")])]))
def test_lone_apostrophe(self): from zope.index.text.parsetree import AndNode from zope.index.text.parsetree import AtomNode parser = self._makeOne() self._expect(parser, "foo ' bar", AndNode([AtomNode("foo"), AtomNode("'"), AtomNode("bar")]), expected_ignored=[])
def test018(self): from zope.index.text.parsetree import AndNode from zope.index.text.parsetree import AtomNode from zope.index.text.parsetree import NotNode from zope.index.text.parsetree import PhraseNode parser = self._makeOne() self._expect(parser, 'booh -"foo bar"', AndNode([AtomNode("booh"), NotNode(PhraseNode(["foo", "bar"]))]))
def test207(self): from zope.index.text.parsetree import AndNode from zope.index.text.parsetree import AtomNode parser = self._makeOne() self._expect(parser, 'foo AND bar NOT stop', AndNode([AtomNode("foo"), AtomNode("bar")]), ["stop"])
def test013(self): from zope.index.text.parsetree import AndNode from zope.index.text.parsetree import AtomNode parser = self._makeOne() self._expect(parser, "((foo bar))", AndNode([AtomNode("foo"), AtomNode("bar")]))
def test003(self): from zope.index.text.parsetree import AndNode from zope.index.text.parsetree import AtomNode parser = self._makeOne() self._expect(parser, "aa and bb AND cc", AndNode([AtomNode("aa"), AtomNode("bb"), AtomNode("cc")]))