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 #************************************************************************* |
(...skipping 10 matching lines...) Expand all Loading... |
21 ifcapable !fts3 { | 21 ifcapable !fts3 { |
22 finish_test | 22 finish_test |
23 return | 23 return |
24 } | 24 } |
25 | 25 |
26 set sqlite_fts3_enable_parentheses 1 | 26 set sqlite_fts3_enable_parentheses 1 |
27 | 27 |
28 proc test_fts3expr {expr} { | 28 proc test_fts3expr {expr} { |
29 db one {SELECT fts3_exprtest('simple', $expr, 'a', 'b', 'c')} | 29 db one {SELECT fts3_exprtest('simple', $expr, 'a', 'b', 'c')} |
30 } | 30 } |
| 31 |
31 do_test fts3expr-1.0 { | 32 do_test fts3expr-1.0 { |
32 test_fts3expr "abcd" | 33 test_fts3expr "abcd" |
33 } {PHRASE 3 0 abcd} | 34 } {PHRASE 3 0 abcd} |
34 do_test fts3expr-1.1 { | 35 do_test fts3expr-1.1 { |
35 test_fts3expr " tag " | 36 test_fts3expr " tag " |
36 } {PHRASE 3 0 tag} | 37 } {PHRASE 3 0 tag} |
37 | 38 |
38 do_test fts3expr-1.2 { | 39 do_test fts3expr-1.2 { |
39 test_fts3expr "ab AND cd" | 40 test_fts3expr "ab AND cd" |
40 } {AND {PHRASE 3 0 ab} {PHRASE 3 0 cd}} | 41 } {AND {PHRASE 3 0 ab} {PHRASE 3 0 cd}} |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 | 489 |
489 do_test fts3expr-7.1 { | 490 do_test fts3expr-7.1 { |
490 execsql { | 491 execsql { |
491 CREATE VIRTUAL TABLE test USING fts3 (keyword); | 492 CREATE VIRTUAL TABLE test USING fts3 (keyword); |
492 INSERT INTO test VALUES ('abc'); | 493 INSERT INTO test VALUES ('abc'); |
493 SELECT * FROM test WHERE keyword MATCH '""'; | 494 SELECT * FROM test WHERE keyword MATCH '""'; |
494 } | 495 } |
495 } {} | 496 } {} |
496 | 497 |
497 | 498 |
| 499 do_test fts3expr-8.0 { test_fts3expr "(blah)" } {PHRASE 3 0 blah} |
| 500 do_test fts3expr-8.1 { test_fts3expr "(blah.)" } {PHRASE 3 0 blah} |
| 501 do_test fts3expr-8.2 { test_fts3expr "(blah,)" } {PHRASE 3 0 blah} |
| 502 do_test fts3expr-8.3 { test_fts3expr "(blah!)" } {PHRASE 3 0 blah} |
| 503 do_test fts3expr-8.4 { test_fts3expr "(blah-)" } {PHRASE 3 0 blah} |
| 504 |
| 505 do_test fts3expr-8.5 { test_fts3expr "((blah.))" } {PHRASE 3 0 blah} |
| 506 do_test fts3expr-8.6 { test_fts3expr "(((blah,)))" } {PHRASE 3 0 blah} |
| 507 do_test fts3expr-8.7 { test_fts3expr "((((blah!))))" } {PHRASE 3 0 blah} |
| 508 |
| 509 do_test fts3expr-8.8 { test_fts3expr "(,(blah-),)" } {PHRASE 3 0 blah} |
| 510 |
498 set sqlite_fts3_enable_parentheses 0 | 511 set sqlite_fts3_enable_parentheses 0 |
| 512 |
| 513 do_test fts3expr-9.1 { |
| 514 test_fts3expr "f (e NEAR/2 a)" |
| 515 } {AND {PHRASE 3 0 f} {NEAR/2 {PHRASE 3 0 e} {PHRASE 3 0 a}}} |
| 516 |
499 finish_test | 517 finish_test |
OLD | NEW |