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 FTS3 module, and in particular
15 # $Id: fts3ad.test,v 1.1 2007/08/20 17:38:42 shess Exp $
18 set testdir [file dirname $argv0]
19 source $testdir/tester.tcl
21 # If SQLITE_ENABLE_FTS3 is defined, omit this file.
29 CREATE VIRTUAL TABLE t1 USING fts3(content, tokenize porter);
30 INSERT INTO t1(rowid, content) VALUES(1, 'running and jumping');
31 SELECT rowid FROM t1 WHERE content MATCH 'run jump';
36 SELECT snippet(t1) FROM t1 WHERE t1 MATCH 'run jump';
38 } {{<b>running</b> and <b>jumping</b>}}
41 INSERT INTO t1(rowid, content)
42 VALUES(2, 'abcdefghijklmnopqrstuvwyxz');
43 SELECT rowid, snippet(t1) FROM t1 WHERE t1 MATCH 'abcdefghijqrstuvwyxz'
45 } {2 <b>abcdefghijklmnopqrstuvwyxz</b>}
48 SELECT rowid, snippet(t1) FROM t1 WHERE t1 MATCH 'abcdefghijXXXXqrstuvwyxz'
50 } {2 <b>abcdefghijklmnopqrstuvwyxz</b>}
53 INSERT INTO t1(rowid, content)
54 VALUES(3, 'The value is 123456789');
55 SELECT rowid, snippet(t1) FROM t1 WHERE t1 MATCH '123789'
57 } {3 {The value is <b>123456789</b>}}
60 SELECT rowid, snippet(t1) FROM t1 WHERE t1 MATCH '123000000789'
62 } {3 {The value is <b>123456789</b>}}
67 CREATE VIRTUAL TABLE t1 USING fts3(content, tokenize porter);
68 INSERT INTO t1(rowid, content) VALUES(1, 'running and jumping');
69 SELECT rowid FROM t1 WHERE content MATCH 'run jump';
75 CREATE VIRTUAL TABLE t1 USING fts3(content, tokenize= porter);
76 INSERT INTO t1(rowid, content) VALUES(1, 'running and jumping');
77 SELECT rowid FROM t1 WHERE content MATCH 'run jump';
83 CREATE VIRTUAL TABLE t1 USING fts3(content, tokenize= simple);
84 INSERT INTO t1(rowid, content) VALUES(1, 'running and jumping');
85 SELECT rowid FROM t1 WHERE content MATCH 'run jump';
91 CREATE VIRTUAL TABLE t1 USING fts3(content, tokenize= porter);
92 INSERT INTO t1(rowid, content) VALUES(1, 'running and jumping');
93 SELECT rowid FROM t1 WHERE content MATCH 'run jump';
99 CREATE VIRTUAL TABLE t1 USING fts3(content, tokenize = porter);
100 INSERT INTO t1(rowid, content) VALUES(1, 'running and jumping');
101 SELECT rowid FROM t1 WHERE content MATCH 'run jump';