diff test/test_indexer.py @ 3547:7728ee93efd2

fix reindexing in Xapian
author Richard Jones <richard@users.sourceforge.net>
date Tue, 07 Feb 2006 04:59:05 +0000
parents a4edd24c32be
children 0bf9f8ae7d1b
line wrap: on
line diff
--- a/test/test_indexer.py	Tue Feb 07 04:14:32 2006 +0000
+++ b/test/test_indexer.py	Tue Feb 07 04:59:05 2006 +0000
@@ -18,7 +18,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
-# $Id: test_indexer.py,v 1.9 2006-02-07 04:14:32 richard Exp $
+# $Id: test_indexer.py,v 1.10 2006-02-07 04:59:05 richard Exp $
 
 import os, unittest, shutil
 
@@ -46,10 +46,22 @@
         self.assertEqual(self.dex.find(['blah']), [('test', '2', 'foo')])
         self.assertEqual(self.dex.find(['blah', 'hello']), [])
 
-        # change
+    def test_change(self):
+        self.dex.add_text(('test', '1', 'foo'), 'a the hello world')
+        self.dex.add_text(('test', '2', 'foo'), 'blah blah the world')
+        self.assertEqual(self.dex.find(['world']), [('test', '1', 'foo'),
+                                                    ('test', '2', 'foo')])
         self.dex.add_text(('test', '1', 'foo'), 'a the hello')
         self.assertEqual(self.dex.find(['world']), [('test', '2', 'foo')])
 
+    def test_clear(self):
+        self.dex.add_text(('test', '1', 'foo'), 'a the hello world')
+        self.dex.add_text(('test', '2', 'foo'), 'blah blah the world')
+        self.assertEqual(self.dex.find(['world']), [('test', '1', 'foo'),
+                                                    ('test', '2', 'foo')])
+        self.dex.add_text(('test', '1', 'foo'), '')
+        self.assertEqual(self.dex.find(['world']), [('test', '2', 'foo')])
+
     def tearDown(self):
         shutil.rmtree('test-index')
 

Roundup Issue Tracker: http://roundup-tracker.org/