Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Unified Diff: third_party/sqlite/sqlite-src-3080704/test/genesis.tcl

Issue 883353008: [sql] Import reference version of SQLite 3.8.7.4. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hold back encoding change which is messing up patch. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/sqlite/sqlite-src-3080704/test/genesis.tcl
diff --git a/third_party/sqlite/src/test/fts4aa.test b/third_party/sqlite/sqlite-src-3080704/test/genesis.tcl
similarity index 99%
copy from third_party/sqlite/src/test/fts4aa.test
copy to third_party/sqlite/sqlite-src-3080704/test/genesis.tcl
index c6fa3b9cd4693a7a3a840fbae5ac2ba242cbbb8e..4ba4c8ea214feb4ce42a3fa0a0bbf717f89cfe31 100644
--- a/third_party/sqlite/src/test/fts4aa.test
+++ b/third_party/sqlite/sqlite-src-3080704/test/genesis.tcl
@@ -8,27 +8,19 @@
# May you share freely, never taking more than you give.
#
#*************************************************************************
-# This file implements regression tests for SQLite library. The
-# focus of this script is testing the FTS4 module.
+# This file implements a TCL function that fills an FTS table with
+# lots of content useful for testing. This routine is broken out into
+# a separate file to facilitate its use by multiple test scripts.
#
-#
-
-set testdir [file dirname $argv0]
-source $testdir/tester.tcl
-# If SQLITE_ENABLE_FTS3 is defined, omit this file.
-ifcapable !fts3 {
- finish_test
- return
-}
-if {[db eval {SELECT sqlite_compileoption_used('ENABLE_FTS4')}]==0} {
- finish_test
- return
-}
+# The fts_kjv_genesis routine is already loaded. This script is a no-op.
+if {[lsearch [info procs] fts_kjv_genesis]>=0} return
-do_test fts4aa-1.0 {
+# This procedure fills an existing FTS3/FTS4 table with many entries.
+# The table needs to have a single column (other than docid) named "words".
+#
+proc fts_kjv_genesis {} {
db eval {
-CREATE VIRTUAL TABLE t1 USING fts4(words, tokenize porter);
BEGIN TRANSACTION;
INSERT INTO t1(docid,words) VALUES(1001001,'In the beginning God created the heaven and the earth.');
INSERT INTO t1(docid,words) VALUES(1001002,'And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.');
@@ -1565,72 +1557,4 @@ INSERT INTO t1(docid,words) VALUES(1050025,'And Joseph took an oath of the child
INSERT INTO t1(docid,words) VALUES(1050026,'So Joseph died, being an hundred and ten years old: and they embalmed him, and he was put in a coffin in Egypt.');
COMMIT;
}
-} {}
-
-
-do_test fts4aa-1.1 {
- db eval {
- SELECT docid FROM t1 EXCEPT SELECT docid FROM t1_docsize
- }
-} {}
-do_test fts4aa-1.2 {
- db eval {
- SELECT docid FROM t1_docsize EXCEPT SELECT docid FROM t1
- }
-} {}
-
-proc mit {blob} {
- set scan(littleEndian) i*
- set scan(bigEndian) I*
- binary scan $blob $scan($::tcl_platform(byteOrder)) r
- return $r
}
-db func mit mit
-
-do_test fts4aa-2.1 {
- db eval {
- SELECT docid, mit(matchinfo(t1)) FROM t1 WHERE t1 MATCH 'melchizedek';
- }
-} {1014018 {1 1 1 1 1 1533 25 20}}
-do_test fts4aa-2.2 {
- db eval {
- SELECT docid, mit(matchinfo(t1)) FROM t1
- WHERE t1 MATCH 'spake hebrew'
- ORDER BY docid;
- }
-} {1039014 {2 1 1 40 40 1 6 6 1533 25 42} 1039017 {2 1 1 40 40 1 6 6 1533 25 26}}
-do_test fts4aa-2.3 {
- db eval {
- SELECT docid, mit(matchinfo(t1)) FROM t1
- WHERE t1 MATCH 'laban overtook jacob'
- ORDER BY docid;
- }
-} {1031025 {3 1 2 54 46 1 3 3 2 181 160 1533 25 24}}
-
-do_test fts4aa-9.1 {
- db eval {
- DELETE FROM t1 WHERE docid!=1050026;
- SELECT hex(size) FROM t1_docsize;
- SELECT hex(value) FROM t1_stat;
- }
-} {17 0117}
-
-do_test fts4aa-9.2 {
- db eval {
- SELECT docid FROM t1 EXCEPT SELECT docid FROM t1_docsize
- }
-} {}
-do_test fts4aa-9.3 {
- db eval {
- SELECT docid FROM t1_docsize EXCEPT SELECT docid FROM t1
- }
-} {}
-do_test fts4aa-9.4 {
- db eval {
- SELECT docid, mit(matchinfo(t1)) FROM t1
- WHERE t1 MATCH 'joseph died in egypt'
- ORDER BY docid;
- }
-} {1050026 {4 1 1 1 1 1 1 1 2 2 1 1 1 1 1 23 23}}
-
-finish_test
« no previous file with comments | « third_party/sqlite/sqlite-src-3080704/test/fuzzerfault.test ('k') | third_party/sqlite/sqlite-src-3080704/test/hexlit.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698