Exemplo n.º 1
0
 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")])]))
Exemplo n.º 2
0
 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")]))
Exemplo n.º 3
0
 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")]))
Exemplo n.º 4
0
 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"))]))
Exemplo n.º 5
0
 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"))]))
Exemplo n.º 6
0
 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=['***'])
Exemplo n.º 7
0
 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=['" "'])
Exemplo n.º 8
0
 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=[])
Exemplo n.º 9
0
 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=['?'])
Exemplo n.º 10
0
 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")])]))
Exemplo n.º 11
0
 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=[])
Exemplo n.º 12
0
 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"]))]))
Exemplo n.º 13
0
 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"])
Exemplo n.º 14
0
 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")]))
Exemplo n.º 15
0
 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")]))