[Zope-CVS] CVS: Products/ZCTextIndex/tests - testQueryParser.py:1.1.2.9

Guido van Rossum guido@python.org
Mon, 13 May 2002 16:26:27 -0400


Update of /cvs-repository/Products/ZCTextIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv11496

Modified Files:
      Tag: TextIndexDS9-branch
	testQueryParser.py 
Log Message:
Tighten the rules for double-quoted phrases; foo"bar" is now two
tokens, ``foo'' and ``"bar"''.


=== Products/ZCTextIndex/tests/testQueryParser.py 1.1.2.8 => 1.1.2.9 ===
                     AndNode([AtomNode("booh"),
                              NotNode(PhraseNode("foo bar"))]))
+        self.expect('foo"bar"',
+                    AndNode([AtomNode("foo"), AtomNode("bar")]))
+        self.expect('"foo"bar',
+                    AndNode([AtomNode("foo"), AtomNode("bar")]))
+        self.expect('foo"bar"blech',
+                    AndNode([AtomNode("foo"), AtomNode("bar"),
+                             AtomNode("blech")]))
 
     def testParseFailures(self):
         self.failure("")
@@ -106,6 +113,7 @@
         self.failure("(NOT foo)")
         self.failure("-foo")
         self.failure("-foo -bar")
+        self.failure('""')
 
 
 def test_suite():