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 #***********************************************************************
12 # This file contains tests focused on prefix indexes.
15 source [file join [file dirname [info script]] fts5_common.tcl]
16 set testprefix fts5prefix2
18 # If SQLITE_ENABLE_FTS5 is defined, omit this file.
26 do_execsql_test 1.$p.0 "
27 CREATE VIRTUAL TABLE t1 USING fts5(xyz, prefix=$p);
29 do_execsql_test 1.$p.1 {
31 ('May you do good and not evil.'),
32 ('May you find forgiveness for yourself and forgive others.'),
33 ('May you share freely, never taking more than you give f.');
36 do_execsql_test 1.$p.2 {
37 SELECT highlight(t1, 0, '[', ']') FROM t1('f*');
39 {May you [find] [forgiveness] [for] yourself and [forgive] others.}
40 {May you share [freely], never taking more than you give [f].}
45 CREATE VIRTUAL TABLE t2 USING fts5(one, prefix=3);
46 INSERT INTO t2 VALUES('top');
47 INSERT INTO t2 VALUES('to');
48 INSERT INTO t2 VALUES('tommy');
52 SELECT * FROM t2('to*');