This commit is contained in:
Kovid Goyal 2021-06-19 13:13:03 +05:30
parent 6e62ccab38
commit d9c0da9ec3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 11 additions and 0 deletions

View File

@ -421,6 +421,7 @@ tokenize(PyObject *self, PyObject *args) {
if (!remove_diacritics) targs[1] = "0";
Tokenizer t(targs, sizeof(targs)/sizeof(targs[0]));
pyobject_raii ans(PyList_New(0));
if (!ans) return NULL;
t.tokenize(ans.ptr(), flags, text, text_length, py_callback);
return ans.detach();
}

View File

@ -150,3 +150,13 @@ class FTSTest(BaseTest):
self.ae(conn.search('moose AND one'), [])
# }}}
def find_tests():
import unittest
return unittest.defaultTestLoader.loadTestsFromTestCase(FTSTest)
def run_tests():
from calibre.utils.run_tests import run_tests
run_tests(find_tests)