diff options
author | dan miller | 2007-10-20 02:49:29 +0000 |
---|---|---|
committer | dan miller | 2007-10-20 02:49:29 +0000 |
commit | e36d23a85ebff914d74bb541558c2b6082b78edb (patch) | |
tree | 54b58fdf162e78af64055282a6035c8d2443389d /libraries/sqlite/unix/sqlite-3.5.1/test/fts2m.test | |
parent | * Fixed an issue whereby avatar chat distances were being calculated against ... (diff) | |
download | opensim-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/fts2m.test')
-rw-r--r-- | libraries/sqlite/unix/sqlite-3.5.1/test/fts2m.test | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/fts2m.test b/libraries/sqlite/unix/sqlite-3.5.1/test/fts2m.test new file mode 100644 index 0000000..6552637 --- /dev/null +++ b/libraries/sqlite/unix/sqlite-3.5.1/test/fts2m.test | |||
@@ -0,0 +1,65 @@ | |||
1 | # 2007 April 9 | ||
2 | # | ||
3 | # The author disclaims copyright to this source code. | ||
4 | # | ||
5 | #************************************************************************* | ||
6 | # This file implements regression tests for SQLite library. fts2 | ||
7 | # DELETE handling assumed all fields were non-null. This was not | ||
8 | # the intention at all. | ||
9 | # | ||
10 | # $Id: fts2m.test,v 1.1 2007/04/09 20:45:42 shess Exp $ | ||
11 | # | ||
12 | |||
13 | set testdir [file dirname $argv0] | ||
14 | source $testdir/tester.tcl | ||
15 | |||
16 | # If SQLITE_ENABLE_FTS2 is defined, omit this file. | ||
17 | ifcapable !fts2 { | ||
18 | finish_test | ||
19 | return | ||
20 | } | ||
21 | |||
22 | db eval { | ||
23 | CREATE VIRTUAL TABLE t1 USING fts2(col_a, col_b); | ||
24 | |||
25 | INSERT INTO t1(rowid, col_a, col_b) VALUES(1, 'testing', 'testing'); | ||
26 | INSERT INTO t1(rowid, col_a, col_b) VALUES(2, 'only a', null); | ||
27 | INSERT INTO t1(rowid, col_a, col_b) VALUES(3, null, 'only b'); | ||
28 | INSERT INTO t1(rowid, col_a, col_b) VALUES(4, null, null); | ||
29 | } | ||
30 | |||
31 | do_test fts2m-1.0 { | ||
32 | execsql { | ||
33 | SELECT COUNT(col_a), COUNT(col_b), COUNT(*) FROM t1; | ||
34 | } | ||
35 | } {2 2 4} | ||
36 | |||
37 | do_test fts2m-1.1 { | ||
38 | execsql { | ||
39 | DELETE FROM t1 WHERE rowid = 1; | ||
40 | SELECT COUNT(col_a), COUNT(col_b), COUNT(*) FROM t1; | ||
41 | } | ||
42 | } {1 1 3} | ||
43 | |||
44 | do_test fts2m-1.2 { | ||
45 | execsql { | ||
46 | DELETE FROM t1 WHERE rowid = 2; | ||
47 | SELECT COUNT(col_a), COUNT(col_b), COUNT(*) FROM t1; | ||
48 | } | ||
49 | } {0 1 2} | ||
50 | |||
51 | do_test fts2m-1.3 { | ||
52 | execsql { | ||
53 | DELETE FROM t1 WHERE rowid = 3; | ||
54 | SELECT COUNT(col_a), COUNT(col_b), COUNT(*) FROM t1; | ||
55 | } | ||
56 | } {0 0 1} | ||
57 | |||
58 | do_test fts2m-1.4 { | ||
59 | execsql { | ||
60 | DELETE FROM t1 WHERE rowid = 4; | ||
61 | SELECT COUNT(col_a), COUNT(col_b), COUNT(*) FROM t1; | ||
62 | } | ||
63 | } {0 0 0} | ||
64 | |||
65 | finish_test | ||