Also add test without diacritics removal

This commit is contained in:
Kovid Goyal 2021-06-16 14:55:04 +05:30
parent bbee5b0acb
commit ae25a1f425
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 1 deletions

View File

@ -108,7 +108,7 @@ private:
int send_token(const icu::UnicodeString &token, int32_t start_offset, int32_t end_offset, int flags = 0) { int send_token(const icu::UnicodeString &token, int32_t start_offset, int32_t end_offset, int flags = 0) {
token_buf.clear(); token_buf.reserve(4 * token.length()); token_buf.clear(); token_buf.reserve(4 * token.length());
token.toUTF8String(token_buf); token.toUTF8String(token_buf);
return current_callback(current_callback_ctx, flags, token_buf.c_str(), token_buf.size(), byte_offsets[start_offset], byte_offsets[end_offset]); return current_callback(current_callback_ctx, flags, token_buf.c_str(), (int)token_buf.size(), byte_offsets[start_offset], byte_offsets[end_offset]);
} }
public: public:

View File

@ -50,4 +50,7 @@ class FTSTest(BaseTest):
conn = TestConn() conn = TestConn()
conn.insert_text('coộl') conn.insert_text('coộl')
self.ae(conn.term_row_counts(), {'cool': 1, 'coộl': 1}) self.ae(conn.term_row_counts(), {'cool': 1, 'coộl': 1})
conn = TestConn(remove_diacritics=False)
conn.insert_text('coộl')
self.ae(conn.term_row_counts(), {'coộl': 1})
# }}} # }}}