From 558b477328486b94a6de227089f1969bf54a8fc1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 28 Jun 2021 18:38:30 +0530 Subject: [PATCH] Add a test for Chinese FTS via the DB object --- src/calibre/db/tests/metadata.db | Bin 264192 -> 264192 bytes src/calibre/db/tests/writing.py | 4 ++++ 2 files changed, 4 insertions(+) diff --git a/src/calibre/db/tests/metadata.db b/src/calibre/db/tests/metadata.db index d0df012f3fb90f4948779a1ec5bea85b92cfad58..57ae6ab43fadf3724e12761935d90f6de9d12789 100644 GIT binary patch delta 131 zcmZpeAkZ*DV1hIw&qNtzM#;&7Jo2nO40^!{jVY}ujIAk5TT__lUgu{1&A`O`f`R!3 p^ZU($9(R}}SQ(ia1Q-~&xR@EF7~p`FVcQ*MMjqmoFMGo*0|4$s8jAn` delta 113 zcmZpeAkZ*DV1hIw_e2?GMv2LSJo2pE40_Io8dF+R7+X`Awx%%8z0S?Rz`(@(o`Lx{ n^ZU($Qyw!5a&a*;NC8DbfSHk*foIzXW>y|{{A!lHVU_^^P`(+a diff --git a/src/calibre/db/tests/writing.py b/src/calibre/db/tests/writing.py index edfca2d997..76a940f9f6 100644 --- a/src/calibre/db/tests/writing.py +++ b/src/calibre/db/tests/writing.py @@ -814,6 +814,10 @@ class WritingTest(BaseTest): results = cache.search_annotations('"word"', highlight_start='[', highlight_end=']', snippet_size=3) self.assertEqual(results[0]['text'], '…some [word] changed…') self.assertRaises(FTSQueryError, cache.search_annotations, 'AND OR') + fts_l = [a(type='bookmark', title='路坎坷走来', seq=1),] + cache.set_annotations_for_book(1, 'moo', fts_l) + results = cache.search_annotations('路', highlight_start='[', highlight_end=']') + self.assertEqual(results[0]['text'], '[路]坎坷走来') annot_list[0][0]['title'] = 'changed title' cache.set_annotations_for_book(1, 'moo', annot_list)