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]
17 set testprefix fts5fuzz1
20 #-------------------------------------------------------------------------
22 do_catchsql_test 1.1 {
23 CREATE VIRTUAL TABLE f1 USING fts5(a
\f b);
24 } {/1 {parse error in.*}/}
27 #-------------------------------------------------------------------------
30 CREATE VIRTUAL TABLE f1 USING fts5(a, b);
31 INSERT INTO f1 VALUES('a b', 'c d');
32 INSERT INTO f1 VALUES('e f', 'a b');
35 do_execsql_test 2.2.1 {
36 SELECT rowid FROM f1('""');
39 do_execsql_test 2.2.2 {
40 SELECT rowid FROM f1('"" AND a');
44 do_execsql_test 2.2.3 {
45 SELECT rowid FROM f1('"" a');
48 do_execsql_test 2.2.4 {
49 SELECT rowid FROM f1('"" OR a');
53 SELECT a, b FROM f1('NEAR("")');
57 SELECT a, b FROM f1('NEAR("", 5)');
61 SELECT a, b FROM f1('NEAR("" c, 5)');
65 SELECT a, b FROM f1('NEAR("" c d, 5)');
69 SELECT a, b FROM f1('NEAR(c d, 5)');
73 SELECT rowid FROM f1('NEAR("a" "b", 5)');
76 #-------------------------------------------------------------------------
79 CREATE VIRTUAL TABLE f2 USING fts5(o, t, tokenize="ascii separators abc");
80 SELECT * FROM f2('a+4');
85 #-------------------------------------------------------------------------
87 do_catchsql_test 4.1 {
88 CREATE VIRTUAL TABLE f2 USING fts5(o, t);
89 SELECT * FROM f2('(8 AND 9)`AND 10');
90 } {1 {fts5: syntax error near "`"}}