| OLD | NEW |
| 1 # 2006 September 9 | 1 # 2006 September 9 |
| 2 # | 2 # |
| 3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
| 4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
| 5 # | 5 # |
| 6 # May you do good and not evil. | 6 # May you do good and not evil. |
| 7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
| 8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
| 9 # | 9 # |
| 10 #************************************************************************* | 10 #************************************************************************* |
| 11 # This file implements regression tests for SQLite library. The | 11 # This file implements regression tests for SQLite library. The |
| 12 # focus of this script is testing the FTS3 module. | 12 # focus of this script is testing the FTS3 module. |
| 13 # | 13 # |
| 14 # $Id: fts3aa.test,v 1.1 2007/08/20 17:38:42 shess Exp $ | 14 # $Id: fts3aa.test,v 1.1 2007/08/20 17:38:42 shess Exp $ |
| 15 # | 15 # |
| 16 | 16 |
| 17 set testdir [file dirname $argv0] | 17 set testdir [file dirname $argv0] |
| 18 source $testdir/tester.tcl | 18 source $testdir/tester.tcl |
| 19 set testprefix fts3aa |
| 19 | 20 |
| 20 # If SQLITE_ENABLE_FTS3 is defined, omit this file. | 21 # If SQLITE_ENABLE_FTS3 is defined, omit this file. |
| 21 ifcapable !fts3 { | 22 ifcapable !fts3 { |
| 22 finish_test | 23 finish_test |
| 23 return | 24 return |
| 24 } | 25 } |
| 25 | 26 |
| 26 # Construct a full-text search table containing five keywords: | 27 # Construct a full-text search table containing five keywords: |
| 27 # one, two, three, four, and five, in various combinations. The | 28 # one, two, three, four, and five, in various combinations. The |
| 28 # rowid for each will be a bitmask for the elements it contains. | 29 # rowid for each will be a bitmask for the elements it contains. |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } {1 {unrecognized parameter: xyz = abc}} | 215 } {1 {unrecognized parameter: xyz = abc}} |
| 215 | 216 |
| 216 do_execsql_test fts3aa-7.4 { | 217 do_execsql_test fts3aa-7.4 { |
| 217 CREATE VIRTUAL TABLE t3 USING fts3(tokenize=simple, tokenize=simple); | 218 CREATE VIRTUAL TABLE t3 USING fts3(tokenize=simple, tokenize=simple); |
| 218 SELECT tokenize FROM t3; | 219 SELECT tokenize FROM t3; |
| 219 } {} | 220 } {} |
| 220 do_catchsql_test fts3aa-7.5 { | 221 do_catchsql_test fts3aa-7.5 { |
| 221 CREATE VIRTUAL TABLE t4 USING fts4(tokenize=simple, tokenize=simple); | 222 CREATE VIRTUAL TABLE t4 USING fts4(tokenize=simple, tokenize=simple); |
| 222 } {1 {unrecognized parameter: tokenize=simple}} | 223 } {1 {unrecognized parameter: tokenize=simple}} |
| 223 | 224 |
| 225 do_execsql_test 8.0 { |
| 226 CREATE VIRTUAL TABLE t0 USING fts4(order=desc); |
| 227 BEGIN; |
| 228 INSERT INTO t0(rowid, content) VALUES(1, 'abc'); |
| 229 UPDATE t0 SET docid=5 WHERE docid=1; |
| 230 INSERT INTO t0(rowid, content) VALUES(6, 'abc'); |
| 231 } |
| 232 do_execsql_test 8.1 { |
| 233 SELECT docid FROM t0 WHERE t0 MATCH 'abc'; |
| 234 } {6 5} |
| 235 do_execsql_test 8.2 { |
| 236 SELECT docid FROM t0 WHERE t0 MATCH '"abc abc"'; |
| 237 } {} |
| 238 do_execsql_test 8.3 { COMMIT } |
| 239 do_execsql_test 8.4 { |
| 240 SELECT docid FROM t0 WHERE t0 MATCH 'abc'; |
| 241 } {6 5} |
| 242 do_execsql_test 8.5 { |
| 243 SELECT docid FROM t0 WHERE t0 MATCH '"abc abc"'; |
| 244 } {} |
| 245 |
| 224 | 246 |
| 225 finish_test | 247 finish_test |
| OLD | NEW |