Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/ext/fts5/test/fts5cat.test # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / ext / fts5 / test / fts5cat.test` 76 lines · 2066 bytes Raw Blame History 1 # 2016 Jan 15 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 source [file join [file dirname [info script]] fts5_common.tcl] 14 ifcapable !fts5 { finish_test ; return } 15 set ::testprefix fts5cat 16 17 18 do_execsql_test 1.0 { 19 CREATE VIRTUAL TABLE t1 USING fts5(x, tokenize="unicode61 categories 'L*'"); 20 INSERT INTO t1 VALUES ('Unlike1option2values3and4column5names'); 21 } 22 23 do_execsql_test 1.1 { 24 SELECT rowid FROM t1('option'); 25 } {1} 26 27 do_execsql_test 1.2 { 28 CREATE VIRTUAL TABLE t2 USING fts5(x); 29 CREATE VIRTUAL TABLE t2t USING fts5vocab(t2, row); 30 31 CREATE VIRTUAL TABLE t3 USING fts5( 32 x, tokenize="unicode61 categories 'L* N* Co Mn'" 33 ); 34 CREATE VIRTUAL TABLE t3t USING fts5vocab(t3, row); 35 36 CREATE VIRTUAL TABLE t4 USING fts5( 37 x, tokenize="unicode61 categories 'L* N* Co M*'" 38 ); 39 CREATE VIRTUAL TABLE t4t USING fts5vocab(t4, row); 40 41 INSERT INTO t2 VALUES ('สนามกีฬา'); 42 INSERT INTO t3 VALUES ('สนามกีฬา'); 43 INSERT INTO t4 VALUES ('สนามกีฬา'); 44 } 45 46 do_execsql_test 1.3 { 47 SELECT * FROM t2t 48 } {สนามก 1 1 ฬา 1 1} 49 50 do_execsql_test 1.4 { 51 SELECT * FROM t3t 52 } {สนามกีฬา 1 1} 53 54 do_execsql_test 1.5 { 55 SELECT * FROM t4t 56 } {สนามกีฬา 1 1} 57 58 #------------------------------------------------------------------------- 59 reset_db 60 do_execsql_test 2.0 " 61 CREATE VIRTUAL TABLE x1 USING fts5(c, 62 tokenize=\"unicode61 categories ' \t'\"); 63 " 64 65 do_catchsql_test 2.1 " 66 CREATE VIRTUAL TABLE x2 USING fts5(c, 67 tokenize=\"unicode61 categories 'N*\t\tMYZ'\"); 68 " {1 {error in tokenizer constructor}} 69 70 do_catchsql_test 2.2 " 71 CREATE VIRTUAL TABLE x2 USING fts5(c, 72 tokenize=\"unicode61 categories 'N*\t\tXYZ'\"); 73 " {1 {error in tokenizer constructor}} 74 75 76 finish_test