sqlite
[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.
Brought by drakestapleton
sqlite / ext / fts5 / test / fts5unicode4.test
| 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 | |
| 14 | source [file join [file dirname [info script]] fts5_common.tcl] |
| 15 | set testprefix fts5unicode4 |
| 16 | |
| 17 | # If SQLITE_ENABLE_FTS5 is not defined, omit this file. |
| 18 | ifcapable !fts5 { |
| 19 | finish_test |
| 20 | return |
| 21 | } |
| 22 | |
| 23 | do_execsql_test 1.0 { |
| 24 | CREATE VIRTUAL TABLE sss USING fts5(a, prefix=3); |
| 25 | } |
| 26 | |
| 27 | do_execsql_test 1.1 { |
| 28 | INSERT INTO sss VALUES('γΎγγ'); |
| 29 | } |
| 30 | |
| 31 | foreach {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 | |
| 61 | finish_test |