[Zope-Checkins] CVS: Zope2 - testUnTextIndex.py:1.1.4.4

Chris McDonough chrism@digicool.com
Thu, 22 Mar 2001 14:20:23 -0500 (EST)


Update of /cvs-repository/Zope2/lib/python/SearchIndex/tests
In directory korak:/home/chrism/sandboxes/2_3Branch/lib/python/SearchIndex/tests

Modified Files:
      Tag: zope-2_3-branch
	testUnTextIndex.py 
Log Message:
Added test for query with embedded quotes.


--- Updated File testUnTextIndex.py in package Zope2 --
--- testUnTextIndex.py	2001/03/22 18:34:08	1.1.4.3
+++ testUnTextIndex.py	2001/03/22 19:20:23	1.1.4.4
@@ -331,6 +331,28 @@
        r=list(r[0].keys())
        assert  r == [0, 6], r
 
+   def checkQuoteMatchingQuery(self):
+       "Check a query with quotes.. this is known to fail under 2.3.1b3-"
+       index=self.dbopen()
+       index._lexicon = SearchIndex.GlobbingLexicon.GlobbingLexicon()
+
+       for i in range(len(self.sample_texts)):
+           self.doc.text=self.sample_texts[i]
+           index.index_object(i, self.doc)
+           get_transaction().commit()
+
+       self.dbclose()
+
+       index=self.dbopen()
+
+       r = index._apply_index({'text':'"This is the time"'})
+       r=list(r[0].keys())
+       assert  r == [0], r
+
+       r = index._apply_index({'text':'"now is the time"'})
+       r=list(r[0].keys())
+       assert  r == [], r
+
    def checkTextIndexOperatorQuery(self):
        "Check a query with 'textindex_operator' in the request"
        index=self.dbopen()