Mercurial > p > roundup > code
comparison test/test_indexer.py @ 4314:b41a033bffcc
- add a small word-splitting test for the indexers...
when answering an mailinglist-mail concerning indexer behaviour
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Sun, 27 Dec 2009 21:18:48 +0000 |
| parents | 2b1241daaa20 |
| children | 6e3e4f24c753 |
comparison
equal
deleted
inserted
replaced
| 4313:7a6c5c117879 | 4314:b41a033bffcc |
|---|---|
| 122 ('test', '2', 'a')]) | 122 ('test', '2', 'a')]) |
| 123 self.assertSeqEqual(self.dex.find(['BBBB']), | 123 self.assertSeqEqual(self.dex.find(['BBBB']), |
| 124 [('test', '1', 'a'), | 124 [('test', '1', 'a'), |
| 125 ('test', '2', 'a')]) | 125 ('test', '2', 'a')]) |
| 126 | 126 |
| 127 def test_wordsplitting(self): | |
| 128 """Test if word splitting works.""" | |
| 129 self.dex.add_text(('test', '1', 'a'), 'aaaa-aaa bbbb*bbb') | |
| 130 self.dex.add_text(('test', '2', 'a'), 'aaaA-aaa BBBB*BBB') | |
| 131 for k in 'aaaa', 'aaa', 'bbbb', 'bbb': | |
| 132 self.assertSeqEqual(self.dex.find([k]), | |
| 133 [('test', '1', 'a'), ('test', '2', 'a')]) | |
| 134 | |
| 127 def tearDown(self): | 135 def tearDown(self): |
| 128 shutil.rmtree('test-index') | 136 shutil.rmtree('test-index') |
| 129 | 137 |
| 130 class XapianIndexerTest(IndexerTest): | 138 class XapianIndexerTest(IndexerTest): |
| 131 def setUp(self): | 139 def setUp(self): |
