3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #*************************************************************************
11 # This file implements regression tests for SQLite library. The
12 # focus of this script is testing the FTS5 module.
15 source [file join [file dirname [info script]] fts5_common.tcl]
16 set testprefix fts5query
18 # If SQLITE_ENABLE_FTS5 is defined, omit this file.
24 for {set tn 1 ; set pgsz 64} {$tn<32} {incr tn; incr pgsz 16} {
28 CREATE VIRTUAL TABLE t1 USING fts5(x);
29 INSERT INTO t1(t1, rank) VALUES('pgsz', $pgsz);
32 foreach x [list aaa bbb ccc ddd eee fff ggg hhh iii jjj] {
33 set doc [string repeat "$x " 30]
34 execsql { INSERT INTO t1 VALUES($doc) }
39 do_execsql_test 1.$tn.2 {
40 INSERT INTO t1(t1) VALUES('integrity-check');
44 foreach x [list a b c d e f g h i j] {
45 do_execsql_test 1.$tn.3.$ret {
46 SELECT rowid FROM t1 WHERE t1 MATCH $x || '*';
52 for {set tn 1 ; set pgsz 64} {$tn<32} {incr tn; incr pgsz 16} {
56 CREATE VIRTUAL TABLE t1 USING fts5(x);
57 INSERT INTO t1(t1, rank) VALUES('pgsz', $pgsz);
60 foreach x [list bbb ddd fff hhh jjj lll nnn ppp rrr ttt] {
61 set doc [string repeat "$x " 30]
62 execsql { INSERT INTO t1 VALUES($doc) }
67 do_execsql_test 2.$tn.2 {
68 INSERT INTO t1(t1) VALUES('integrity-check');
72 foreach x [list a c e g i k m o q s u] {
73 do_execsql_test 2.$tn.3.$ret {
74 SELECT rowid FROM t1 WHERE t1 MATCH $x || '*';
82 CREATE VIRTUAL TABLE x1 USING fts5(a);
83 INSERT INTO x1(rowid, a) VALUES(-1000000000000, 'toyota');
84 INSERT INTO x1(rowid, a) VALUES(1, 'tarago');
87 SELECT rowid FROM x1('t*');