aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/sqlite/unix/sqlite-3.5.1/test/fts3ae.test
diff options
context:
space:
mode:
authordan miller2007-10-20 02:49:29 +0000
committerdan miller2007-10-20 02:49:29 +0000
commite36d23a85ebff914d74bb541558c2b6082b78edb (patch)
tree54b58fdf162e78af64055282a6035c8d2443389d /libraries/sqlite/unix/sqlite-3.5.1/test/fts3ae.test
parent* Fixed an issue whereby avatar chat distances were being calculated against ... (diff)
downloadopensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.zip
opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.gz
opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.bz2
opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.xz
sqlite source (unix build) added to libraries
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/test/fts3ae.test')
-rw-r--r--libraries/sqlite/unix/sqlite-3.5.1/test/fts3ae.test85
1 files changed, 85 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/fts3ae.test b/libraries/sqlite/unix/sqlite-3.5.1/test/fts3ae.test
new file mode 100644
index 0000000..949a72b
--- /dev/null
+++ b/libraries/sqlite/unix/sqlite-3.5.1/test/fts3ae.test
@@ -0,0 +1,85 @@
1# 2006 October 19
2#
3# The author disclaims copyright to this source code.
4#
5#*************************************************************************
6# This file implements regression tests for SQLite library. The
7# focus of this script is testing deletions in the FTS3 module.
8#
9# $Id: fts3ae.test,v 1.1 2007/08/20 17:38:42 shess Exp $
10#
11
12set testdir [file dirname $argv0]
13source $testdir/tester.tcl
14
15# If SQLITE_ENABLE_FTS3 is defined, omit this file.
16ifcapable !fts3 {
17 finish_test
18 return
19}
20
21# Construct a full-text search table containing keywords which are the
22# ordinal numbers of the bit positions set for a sequence of integers,
23# which are used for the rowid. There are a total of 30 INSERT and
24# DELETE statements, so that we'll test both the segmentMerge() merge
25# (over the first 16) and the termSelect() merge (over the level-1
26# segment and 14 level-0 segments).
27db eval {
28 CREATE VIRTUAL TABLE t1 USING fts3(content);
29 INSERT INTO t1 (rowid, content) VALUES(1, 'one');
30 INSERT INTO t1 (rowid, content) VALUES(2, 'two');
31 INSERT INTO t1 (rowid, content) VALUES(3, 'one two');
32 INSERT INTO t1 (rowid, content) VALUES(4, 'three');
33 DELETE FROM t1 WHERE rowid = 1;
34 INSERT INTO t1 (rowid, content) VALUES(5, 'one three');
35 INSERT INTO t1 (rowid, content) VALUES(6, 'two three');
36 INSERT INTO t1 (rowid, content) VALUES(7, 'one two three');
37 DELETE FROM t1 WHERE rowid = 4;
38 INSERT INTO t1 (rowid, content) VALUES(8, 'four');
39 INSERT INTO t1 (rowid, content) VALUES(9, 'one four');
40 INSERT INTO t1 (rowid, content) VALUES(10, 'two four');
41 DELETE FROM t1 WHERE rowid = 7;
42 INSERT INTO t1 (rowid, content) VALUES(11, 'one two four');
43 INSERT INTO t1 (rowid, content) VALUES(12, 'three four');
44 INSERT INTO t1 (rowid, content) VALUES(13, 'one three four');
45 DELETE FROM t1 WHERE rowid = 10;
46 INSERT INTO t1 (rowid, content) VALUES(14, 'two three four');
47 INSERT INTO t1 (rowid, content) VALUES(15, 'one two three four');
48 INSERT INTO t1 (rowid, content) VALUES(16, 'five');
49 DELETE FROM t1 WHERE rowid = 13;
50 INSERT INTO t1 (rowid, content) VALUES(17, 'one five');
51 INSERT INTO t1 (rowid, content) VALUES(18, 'two five');
52 INSERT INTO t1 (rowid, content) VALUES(19, 'one two five');
53 DELETE FROM t1 WHERE rowid = 16;
54 INSERT INTO t1 (rowid, content) VALUES(20, 'three five');
55 INSERT INTO t1 (rowid, content) VALUES(21, 'one three five');
56 INSERT INTO t1 (rowid, content) VALUES(22, 'two three five');
57 DELETE FROM t1 WHERE rowid = 19;
58 DELETE FROM t1 WHERE rowid = 22;
59}
60
61do_test fts3af-1.1 {
62 execsql {SELECT COUNT(*) FROM t1}
63} {14}
64
65do_test fts3ae-2.1 {
66 execsql {SELECT rowid FROM t1 WHERE content MATCH 'one'}
67} {3 5 9 11 15 17 21}
68
69do_test fts3ae-2.2 {
70 execsql {SELECT rowid FROM t1 WHERE content MATCH 'two'}
71} {2 3 6 11 14 15 18}
72
73do_test fts3ae-2.3 {
74 execsql {SELECT rowid FROM t1 WHERE content MATCH 'three'}
75} {5 6 12 14 15 20 21}
76
77do_test fts3ae-2.4 {
78 execsql {SELECT rowid FROM t1 WHERE content MATCH 'four'}
79} {8 9 11 12 14 15}
80
81do_test fts3ae-2.5 {
82 execsql {SELECT rowid FROM t1 WHERE content MATCH 'five'}
83} {17 18 20 21}
84
85finish_test