summaryrefslogtreecommitdiff
path: root/test/fts3conf.test
diff options
context:
space:
mode:
authorHans-Christoph Steiner <hans@eds.org>2013-08-13 15:43:01 -0400
committerHans-Christoph Steiner <hans@eds.org>2013-08-13 15:43:01 -0400
commit4228998fd796fa2f9e84fb73632e0a07cc7cd188 (patch)
tree15b2336f351468fedd0c39e9de4ad905a686f3b0 /test/fts3conf.test
parentbdee7cf7d974b2f70d5934786c5666006e7360be (diff)
parent08119c361d1181b3e8f1abb429236e488a664753 (diff)
Merge tag 'upstream/2.2.1'
Upstream version 2.2.1 # gpg: Signature made Tue 13 Aug 2013 03:42:56 PM EDT using RSA key ID 374BBE81 # gpg: Good signature from "Hans-Christoph Steiner <hans@at.or.at>" # gpg: aka "[jpeg image of size 5408]" # gpg: aka "Hans-Christoph Steiner <hs420@nyu.edu>" # gpg: aka "Hans-Christoph Steiner <hans@eds.org>" # gpg: aka "Hans-Christoph Steiner <hans@guardianproject.info>" # gpg: aka "Hans-Christoph Steiner <hansi@nyu.edu>" # gpg: aka "Hans-Christoph Steiner <hans@guardianproject.info>"
Diffstat (limited to 'test/fts3conf.test')
-rw-r--r--test/fts3conf.test42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/fts3conf.test b/test/fts3conf.test
index ce41027..e91efbe 100644
--- a/test/fts3conf.test
+++ b/test/fts3conf.test
@@ -136,4 +136,46 @@ do_execsql_test 2.2.2 { COMMIT }
do_execsql_test 2.2.3 { SELECT * FROM t1 } {{a b c} {a b c}}
fts3_integrity 2.2.4 db t1
+do_execsql_test 3.1 {
+ CREATE VIRTUAL TABLE t3 USING fts4;
+ REPLACE INTO t3(docid, content) VALUES (1, 'one two');
+ SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'one'
+} {X'0100000002000000'}
+
+do_execsql_test 3.2 {
+ REPLACE INTO t3(docid, content) VALUES (2, 'one two three four');
+ SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'four'
+} {X'0200000003000000'}
+
+do_execsql_test 3.3 {
+ REPLACE INTO t3(docid, content) VALUES (1, 'one two three four five six');
+ SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'six'
+} {X'0200000005000000'}
+
+do_execsql_test 3.4 {
+ UPDATE OR REPLACE t3 SET docid = 2 WHERE docid=1;
+ SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'six'
+} {X'0100000006000000'}
+
+do_execsql_test 3.5 {
+ UPDATE OR REPLACE t3 SET docid = 3 WHERE docid=2;
+ SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'six'
+} {X'0100000006000000'}
+
+do_execsql_test 3.6 {
+ REPLACE INTO t3(docid, content) VALUES (3, 'one two');
+ SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'one'
+} {X'0100000002000000'}
+
+do_execsql_test 3.7 {
+ REPLACE INTO t3(docid, content) VALUES (NULL, 'one two three four');
+ REPLACE INTO t3(docid, content) VALUES (NULL, 'one two three four five six');
+ SELECT docid FROM t3;
+} {3 4 5}
+
+do_execsql_test 3.8 {
+ UPDATE OR REPLACE t3 SET docid = 5, content='three four' WHERE docid = 4;
+ SELECT quote(matchinfo(t3, 'na')) FROM t3 WHERE t3 MATCH 'one'
+} {X'0200000002000000'}
+
finish_test