Code

- add a small word-splitting test for the indexers when answering an
authorschlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2>
Sun, 27 Dec 2009 21:18:48 +0000 (21:18 +0000)
committerschlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2>
Sun, 27 Dec 2009 21:18:48 +0000 (21:18 +0000)
  mailinglist-mail concerning indexer behaviour

git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4418 57a73879-2fb5-44c3-a270-3262357dd7e2

test/test_indexer.py

index 1b4d9098bf5d46d295183a209d1fd3289808d40d..5d8a395efa2d774e0ad710c2397c50afda1972b6 100644 (file)
@@ -124,6 +124,14 @@ class IndexerTest(unittest.TestCase):
                                                     [('test', '1', 'a'),
                                                      ('test', '2', 'a')])
 
+    def test_wordsplitting(self):
+        """Test if word splitting works."""
+        self.dex.add_text(('test', '1', 'a'), 'aaaa-aaa bbbb*bbb')
+        self.dex.add_text(('test', '2', 'a'), 'aaaA-aaa BBBB*BBB')
+        for k in 'aaaa', 'aaa', 'bbbb', 'bbb':
+            self.assertSeqEqual(self.dex.find([k]),
+                [('test', '1', 'a'), ('test', '2', 'a')])
+
     def tearDown(self):
         shutil.rmtree('test-index')