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

Unified Diff: third_party/sqlite/src/ext/fts5/test/fts5tokenizer.test

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 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/src/ext/fts5/test/fts5tokenizer.test
diff --git a/third_party/sqlite/src/ext/fts5/test/fts5tokenizer.test b/third_party/sqlite/src/ext/fts5/test/fts5tokenizer.test
index 9316d3c23452c3e1f8ef3d2b3dfc805518bd8ee2..f68aa19a1057b4d271c999dddd8b5e4197053076 100644
--- a/third_party/sqlite/src/ext/fts5/test/fts5tokenizer.test
+++ b/third_party/sqlite/src/ext/fts5/test/fts5tokenizer.test
@@ -262,5 +262,44 @@ do_execsql_test 8.3 {
brown dog fox jump lazi over quick the
}
+#-------------------------------------------------------------------------
+# Check that the FTS5_TOKENIZE_PREFIX flag is passed to the tokenizer
+# implementation.
+#
+reset_db
+proc tcl_create {args} { return "tcl_tokenize" }
+sqlite3_fts5_create_tokenizer db tcl tcl_create
+set ::flags [list]
+proc tcl_tokenize {tflags text} {
+ lappend ::flags $tflags
+ foreach {w iStart iEnd} [fts5_tokenize_split $text] {
+ sqlite3_fts5_token $w $iStart $iEnd
+ }
+}
+
+do_execsql_test 9.1.1 {
+ CREATE VIRTUAL TABLE t1 USING fts5(a, tokenize=tcl);
+ INSERT INTO t1 VALUES('abc');
+ INSERT INTO t1 VALUES('xyz');
+} {}
+do_test 9.1.2 { set ::flags } {document document}
+
+set ::flags [list]
+do_execsql_test 9.2.1 { SELECT * FROM t1('abc'); } {abc}
+do_test 9.2.2 { set ::flags } {query}
+
+set ::flags [list]
+do_execsql_test 9.3.1 { SELECT * FROM t1('ab*'); } {abc}
+do_test 9.3.2 { set ::flags } {prefixquery}
+
+set ::flags [list]
+do_execsql_test 9.4.1 { SELECT * FROM t1('"abc xyz" *'); } {}
+do_test 9.4.2 { set ::flags } {prefixquery}
+
+set ::flags [list]
+do_execsql_test 9.5.1 { SELECT * FROM t1('"abc xyz*"'); } {}
+do_test 9.5.2 { set ::flags } {query}
+
+
finish_test
« no previous file with comments | « third_party/sqlite/src/ext/fts5/test/fts5tok2.test ('k') | third_party/sqlite/src/ext/fts5/test/fts5unicode2.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698