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

Unified Diff: third_party/sqlite/src/ext/fts5/test/fts5ak.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
« no previous file with comments | « third_party/sqlite/src/ext/fts5/test/fts5ai.test ('k') | third_party/sqlite/src/ext/fts5/test/fts5al.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/ext/fts5/test/fts5ak.test
diff --git a/third_party/sqlite/src/ext/fts5/test/fts5ak.test b/third_party/sqlite/src/ext/fts5/test/fts5ak.test
index 4eb28324c940ee98d3b329a2fc24369be3d9bc47..0f699a601f13fbf0cd6d308f29163f70ad5e252f 100644
--- a/third_party/sqlite/src/ext/fts5/test/fts5ak.test
+++ b/third_party/sqlite/src/ext/fts5/test/fts5ak.test
@@ -23,8 +23,10 @@ ifcapable !fts5 {
return
}
+foreach_detail_mode $testprefix {
+
do_execsql_test 1.1 {
- CREATE VIRTUAL TABLE ft1 USING fts5(x);
+ CREATE VIRTUAL TABLE ft1 USING fts5(x, detail=%DETAIL%);
INSERT INTO ft1 VALUES('i d d a g i b g d d');
INSERT INTO ft1 VALUES('h d b j c c g a c a');
INSERT INTO ft1 VALUES('e j a e f h b f h h');
@@ -35,6 +37,9 @@ do_execsql_test 1.1 {
INSERT INTO ft1 VALUES('i c c f a d g h j e');
INSERT INTO ft1 VALUES('i d i g c d c h b f');
INSERT INTO ft1 VALUES('g d a e h a b c f j');
+
+ CREATE VIRTUAL TABLE ft2 USING fts5(x, detail=%DETAIL%);
+ INSERT INTO ft2 VALUES('a b c d e f g h i j');
}
do_execsql_test 1.2 {
@@ -49,19 +54,6 @@ do_execsql_test 1.2 {
}
do_execsql_test 1.3 {
- SELECT highlight(ft1, 0, '[', ']') FROM ft1 WHERE ft1 MATCH 'h + d';
-} {
- {[h d] b j c c g a c a}
- {j f [h d] g h i b d f}
-}
-
-do_execsql_test 1.4 {
- SELECT highlight(ft1, 0, '[', ']') FROM ft1 WHERE ft1 MATCH 'd + d';
-} {
- {i [d d] a g i b g [d d]}
-}
-
-do_execsql_test 1.5 {
SELECT highlight(ft1, 0, '[', ']') FROM ft1 WHERE ft1 MATCH 'e e e'
} {
{[e] j a [e] f h b f h h}
@@ -72,57 +64,71 @@ do_execsql_test 1.5 {
{g d a [e] h a b c f j}
}
-do_execsql_test 1.6 {
- SELECT highlight(ft1, 0, '[', ']') FROM ft1 WHERE ft1 MATCH 'd + d d + d';
+do_execsql_test 1.4 {
+ SELECT highlight(ft2, 0, '[', ']') FROM ft2 WHERE ft2 MATCH 'f d'
} {
- {i [d d] a g i b g [d d]}
+ {a b c [d] e [f] g h i j}
+}
+
+do_execsql_test 1.5 {
+ SELECT highlight(ft2, 0, '[', ']') FROM ft2 WHERE ft2 MATCH 'd f'
+} {
+ {a b c [d] e [f] g h i j}
}
+#-------------------------------------------------------------------------
+# Tests below this point require detail=full.
+#-------------------------------------------------------------------------
+if {[detail_is_full]==0} continue
+
+
do_execsql_test 2.1 {
- CREATE VIRTUAL TABLE ft2 USING fts5(x);
- INSERT INTO ft2 VALUES('a b c d e f g h i j');
+ SELECT highlight(ft1, 0, '[', ']') FROM ft1 WHERE ft1 MATCH 'h + d';
+} {
+ {[h d] b j c c g a c a}
+ {j f [h d] g h i b d f}
}
do_execsql_test 2.2 {
+ SELECT highlight(ft1, 0, '[', ']') FROM ft1 WHERE ft1 MATCH 'd + d';
+} {
+ {i [d d] a g i b g [d d]}
+}
+
+do_execsql_test 2.3 {
+ SELECT highlight(ft1, 0, '[', ']') FROM ft1 WHERE ft1 MATCH 'd + d d + d';
+} {
+ {i [d d] a g i b g [d d]}
+}
+
+do_execsql_test 2.4 {
SELECT highlight(ft2, 0, '[', ']') FROM ft2 WHERE ft2 MATCH 'b+c+d c+d+e'
} {{a [b c d e] f g h i j}}
-do_execsql_test 2.3 {
+do_execsql_test 2.5 {
SELECT highlight(ft2, 0, '[', ']') FROM ft2 WHERE ft2 MATCH 'b+c+d e+f+g'
} {
{a [b c d] [e f g] h i j}
}
-do_execsql_test 2.4 {
+do_execsql_test 2.6 {
SELECT highlight(ft2, 0, '[', ']') FROM ft2 WHERE ft2 MATCH 'b+c+d c'
} {
{a [b c d] e f g h i j}
}
-do_execsql_test 2.5 {
+do_execsql_test 2.7 {
SELECT highlight(ft2, 0, '[', ']') FROM ft2 WHERE ft2 MATCH 'b+c c+d+e'
} {
{a [b c d e] f g h i j}
}
-do_execsql_test 2.6.1 {
- SELECT highlight(ft2, 0, '[', ']') FROM ft2 WHERE ft2 MATCH 'f d'
-} {
- {a b c [d] e [f] g h i j}
-}
-
-do_execsql_test 2.6.2 {
- SELECT highlight(ft2, 0, '[', ']') FROM ft2 WHERE ft2 MATCH 'd f'
-} {
- {a b c [d] e [f] g h i j}
-}
-
#-------------------------------------------------------------------------
# The example from the docs.
#
do_execsql_test 3.1 {
-- Assuming this:
- CREATE VIRTUAL TABLE ft USING fts5(a);
+ CREATE VIRTUAL TABLE ft USING fts5(a, detail=%DETAIL%);
INSERT INTO ft VALUES('a b c x c d e');
INSERT INTO ft VALUES('a b c c d e');
INSERT INTO ft VALUES('a b c d e');
@@ -138,6 +144,7 @@ do_execsql_test 3.1 {
{[a b c d e]}
}
+}
finish_test
« no previous file with comments | « third_party/sqlite/src/ext/fts5/test/fts5ai.test ('k') | third_party/sqlite/src/ext/fts5/test/fts5al.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698