interplane.Get Omega
Read in your language

sqlite

[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.

Brought by drakestapleton

branch master Branches Tags History

sqlite / ext / fts5 / test / fts5unicode4.test

61 lines · 1278 bytes Raw Blame History
1# 2018 July 25
2#
3# The author disclaims copyright to this source code. In place of
4# a legal notice, here is a blessing:
5#
6# May you do good and not evil.
7# May you find forgiveness for yourself and forgive others.
8# May you share freely, never taking more than you give.
9#
10#***********************************************************************
11#
12#
13
14source [file join [file dirname [info script]] fts5_common.tcl]
15set testprefix fts5unicode4
16
17# If SQLITE_ENABLE_FTS5 is not defined, omit this file.
18ifcapable !fts5 {
19 finish_test
20 return
21}
22
23do_execsql_test 1.0 {
24 CREATE VIRTUAL TABLE sss USING fts5(a, prefix=3);
25}
26
27do_execsql_test 1.1 {
28 INSERT INTO sss VALUES('γΎγ‚Šγ‚„');
29}
30
31foreach {tn enc tok} {
32 1 utf-8 ascii
33 2 utf-16 ascii
34 3 utf-8 unicode61
35 4 utf-16 unicode61
36} {
37 reset_db
38
39 do_execsql_test 1.$tn.0 "
40 PRAGMA encoding = '$enc';
41 CREATE VIRTUAL TABLE vt2 USING fts5(c0, c1, tokenize=$tok);
42 "
43
44 do_execsql_test 1.$tn.1 {
45 INSERT INTO vt2(c0, c1) VALUES ('bhal', x'17db');
46 }
47
48 do_execsql_test 1.$tn.2 {
49 UPDATE vt2 SET c0='bhal';
50 }
51
52 do_execsql_test 1.$tn.3 {
53 INSERT INTO vt2(vt2) VALUES('integrity-check')
54 }
55
56 do_execsql_test 1.$tn.4 {
57 SELECT quote(c1) FROM vt2
58 } {X'17DB'}
59}
60
61finish_test