------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-C Updates\sto\ssnippet()\sand\soffsets()\sfunctions\sof\sFTS3\sso\sthat\sthey\swork\nsanely\sfollowing\san\sOOM\sfault.
-D 2009-11-28T21:33:21
+C Add\stest\scases\sfor\sexamples\srecently\sadded\sto\sdocumentation\sfile\sfts3.html.
+D 2009-11-30T08:55:04
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in c5827ead754ab32b9585487177c93bb00b9497b3
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F test/diskfull.test 0cede7ef9d8f415d9d3944005c76be7589bb5ebb
F test/distinctagg.test 1a6ef9c87a58669438fc771450d7a72577417376
F test/e_fkey.test fd1fcf89badd5f2773d7ac04775b5ff3488eda17
-F test/e_fts3.test 488055f7c223e289ea341d55a7e1dd5281893b93
+F test/e_fts3.test 24bb398086eca6d8d3dab64d383d5bb2dd4ff681
F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea
F test/enc2.test 6d91a5286f59add0cfcbb2d0da913b76f2242398
F test/enc3.test 5c550d59ff31dccdba5d1a02ae11c7047d77c041
F test/fts2r.test b154c30b63061d8725e320fba1a39e2201cadd5e
F test/fts2token.test d8070b241a15ff13592a9ae4a8b7c171af6f445a
F test/fts3.test f4f380d3717493605270dfa3b0fa893ea0afb18d
-F test/fts3_common.tcl cdc89bb78754d54b19d8a5dfabd14575742a5293
+F test/fts3_common.tcl 31935839b1b601a5955572cb4e8060513c96bde0
F test/fts3aa.test 5327d4c1d9b6c61021696746cc9a6cdc5bf159c0
F test/fts3ab.test 09aeaa162aee6513d9ff336b6932211008b9d1f9
F test/fts3ac.test 356280144a2c92aa7b11474afadfe62a437fcd69
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 31eed4f8f95f0799d634eccbd9e09cb58172d250
-R 63b6d1158b26a83c6b254a0d208f841c
-U drh
-Z 8559238aab4fefe4430f422ac07d6956
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.6 (GNU/Linux)
-
-iD8DBQFLEZckoxKgR168RlERAilJAJ9fOhH9A66qH4Y5YOtTa1Ji3y2FSACcC046
-fNgY4pufsjXCsUyJbj/lIyo=
-=K2mf
------END PGP SIGNATURE-----
+P b939a37a8ce296785a300e79ab9d3d87ad91343f
+R 07bf5d7ea8efdfde49b03310dbe8e9d5
+U dan
+Z 5540823be73c9695614535782a706576
-b939a37a8ce296785a300e79ab9d3d87ad91343f
\ No newline at end of file
+498922cc356316a3ec59320529b685728e407746
\ No newline at end of file
##########################################################################
+##########################################################################
+# Test the example in section 5 (custom tokenizers).
+#
+ddl_test 2.1.1 { CREATE VIRTUAL TABLE simple USING fts3(tokenize=simple) }
+write_test 2.1.2 simple_content {
+ INSERT INTO simple VALUES('Right now they''re very frustrated')
+}
+read_test 2.1.3 {SELECT docid FROM simple WHERE simple MATCH 'Frustrated'} {1}
+read_test 2.1.4 {SELECT docid FROM simple WHERE simple MATCH 'Frustration'} {}
+
+ddl_test 2.2.1 { CREATE VIRTUAL TABLE porter USING fts3(tokenize=porter) }
+write_test 2.2.2 porter_content {
+ INSERT INTO porter VALUES('Right now they''re very frustrated')
+}
+read_test 2.2.3 {SELECT docid FROM porter WHERE porter MATCH 'Frustrated'} {1}
+read_test 2.2.4 {SELECT docid FROM porter WHERE porter MATCH 'Frustration'} {1}
+
+##########################################################################
+# Test the examples in section 4 (auxillary functions).
+#
+ddl_test 3.1.1 { CREATE VIRTUAL TABLE mail USING fts3(subject, body) }
+
+write_test 3.1.2 mail_content {
+ INSERT INTO mail VALUES(
+ 'hello world', 'This message is a hello world message.');
+}
+write_test 3.1.3 mail_content {
+ INSERT INTO mail VALUES(
+ 'urgent: serious', 'This mail is seen as a more serious mail');
}
+
+read_test 3.1.4 {
+ SELECT offsets(mail) FROM mail WHERE mail MATCH 'world';
+} {{0 0 6 5 1 0 24 5}}
+read_test 3.1.5 {
+ SELECT offsets(mail) FROM mail WHERE mail MATCH 'message'
+} {{1 0 5 7 1 0 30 7}}
+read_test 3.1.6 {
+ SELECT offsets(mail) FROM mail WHERE mail MATCH '"serious mail"'
+} {{1 0 28 7 1 1 36 4}}
+
+ddl_test 3.2.1 { CREATE VIRTUAL TABLE text USING fts3() }
+
+write_test 3.2.2 text_content {
+ INSERT INTO text VALUES('
+ During 30 Nov-1 Dec, 2-3oC drops. Cool in the upper portion, minimum temperature 14-16oC and cool elsewhere, minimum temperature 17-20oC. Cold to very cold on mountaintops, minimum temperature 6-12oC. Northeasterly winds 15-30 km/hr. After that, temperature increases. Northeasterly winds 15-30 km/hr.
+ ');
+}
+
+read_test 3.2.3 {
+ SELECT snippet(text) FROM text WHERE text MATCH 'cold'
+} {{<b>...</b> elsewhere, minimum temperature 17-20oC. <b>Cold</b> to very <b>cold</b> on mountaintops, minimum <b>...</b>}}
+
+read_test 3.2.4 {
+ SELECT snippet(text, '[', ']', '...') FROM text WHERE text MATCH '"min* tem*"'
+} {{... 2-3oC drops. Cool in the upper portion, [minimum] [temperature] 14-16oC and cool elsewhere, [minimum] ...}}
+
+#break
+}
+
finish_test
if {$::DO_MALLOC_TEST} {sqlite3_memdebug_fail $iFail -repeat $nRepeat}
set res [catchsql $sql]
- if {[lsearch $answers $res]>=0} {
+ if {[lsearch -exact $answers $res]>=0} {
set res $str
}
do_test $name.$zName.$iFail [list set {} $res] $str