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

Unified Diff: third_party/sqlite/sqlite-src-3080704/test/fts3aux2.test

Issue 949043002: Add //third_party/sqlite to dirs_to_snapshot, remove net_sql.patch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/fts3aux2.test
diff --git a/third_party/sqlite/sqlite-src-3080704/test/fts3aux2.test b/third_party/sqlite/sqlite-src-3080704/test/fts3aux2.test
new file mode 100644
index 0000000000000000000000000000000000000000..e108fc4b80b583933e5dbfc5b69010391f37c1f4
--- /dev/null
+++ b/third_party/sqlite/sqlite-src-3080704/test/fts3aux2.test
@@ -0,0 +1,144 @@
+# 2011 January 27
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# 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 FTS3 module.
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+ifcapable !fts3 { finish_test ; return }
+set ::testprefix fts3aux2
+
+do_execsql_test 1.1 {
+ CREATE VIRTUAL TABLE t1 USING fts4(a, b, languageid=l);
+ INSERT INTO t1(a, b, l) VALUES
+ ('zero zero', 'zero zero', 0),
+ ('one two', 'three four', 1),
+ ('five six', 'seven eight', 2)
+ ;
+ CREATE VIRTUAL TABLE terms USING fts4aux(t1);
+} {}
+
+do_execsql_test 1.2.1 {
+ SELECT term, documents, occurrences, languageid FROM terms WHERE col = '*';
+} {zero 1 4 0}
+
+do_execsql_test 1.2.2 {
+ SELECT * FROM terms;
+} {zero * 1 4 zero 0 1 2 zero 1 1 2}
+
+do_execsql_test 1.2.3 {
+ SELECT * FROM terms WHERE languageid='';
+} {}
+
+do_execsql_test 1.2.4 {
+ SELECT * FROM terms WHERE languageid=-1;
+} {}
+
+do_execsql_test 1.2.5 {
+ SELECT * FROM terms WHERE languageid=9223372036854775807;
+} {}
+
+do_execsql_test 1.2.6 {
+ SELECT * FROM terms WHERE languageid=-9223372036854775808;
+} {}
+
+do_execsql_test 1.2.7 {
+ SELECT * FROM terms WHERE languageid=NULL;
+} {}
+
+do_execsql_test 1.3.1 {
+ SELECT term, documents, occurrences, languageid
+ FROM terms WHERE col = '*' AND languageid=1;
+} {
+ four 1 1 1 one 1 1 1 three 1 1 1 two 1 1 1
+}
+
+do_execsql_test 1.3.2 {
+ SELECT term, col, documents, occurrences, languageid
+ FROM terms WHERE languageid=1;
+} {
+ four * 1 1 1 four 1 1 1 1
+ one * 1 1 1 one 0 1 1 1
+ three * 1 1 1 three 1 1 1 1
+ two * 1 1 1 two 0 1 1 1
+}
+
+do_execsql_test 1.3.3 {
+ SELECT term, col, documents, occurrences, languageid
+ FROM terms WHERE languageid=1 AND term='zero'
+} {
+}
+
+do_execsql_test 1.3.4 {
+ SELECT term, col, documents, occurrences, languageid
+ FROM terms WHERE languageid='1' AND term='two'
+} {
+ two * 1 1 1 two 0 1 1 1
+}
+
+do_execsql_test 1.3.5 {
+ SELECT term, col, documents, occurrences, languageid
+ FROM terms WHERE languageid='+1' AND term>'four'
+} {
+ one * 1 1 1 one 0 1 1 1
+ three * 1 1 1 three 1 1 1 1
+ two * 1 1 1 two 0 1 1 1
+}
+
+do_execsql_test 1.4.1 {
+ SELECT term, documents, occurrences, languageid
+ FROM terms WHERE col = '*' AND languageid=2;
+} {
+ eight 1 1 2 five 1 1 2 seven 1 1 2 six 1 1 2
+}
+
+do_execsql_test 1.4.2 {
+ SELECT term, col, documents, occurrences, languageid
+ FROM terms WHERE languageid=2;
+} {
+ eight * 1 1 2 eight 1 1 1 2
+ five * 1 1 2 five 0 1 1 2
+ seven * 1 1 2 seven 1 1 1 2
+ six * 1 1 2 six 0 1 1 2
+}
+
+do_execsql_test 1.4.3 {
+ SELECT term, col, documents, occurrences, languageid
+ FROM terms WHERE languageid=2 AND term='five';
+} {
+ five * 1 1 2 five 0 1 1 2
+}
+
+do_execsql_test 1.4.4 {
+ SELECT term, col, documents, occurrences, languageid
+ FROM terms WHERE term='five' AND languageid=2
+} {
+ five * 1 1 2 five 0 1 1 2
+}
+
+do_execsql_test 1.4.5 {
+ SELECT term, col, documents, occurrences, languageid
+ FROM terms WHERE term>='seven' AND languageid=2
+} {
+ seven * 1 1 2 seven 1 1 1 2
+ six * 1 1 2 six 0 1 1 2
+}
+
+do_execsql_test 1.4.6 {
+ SELECT term, col, documents, occurrences, languageid
+ FROM terms WHERE term>='e' AND term<'seven' AND languageid=2
+} {
+ eight * 1 1 2 eight 1 1 1 2
+ five * 1 1 2 five 0 1 1 2
+}
+
+finish_test
« no previous file with comments | « third_party/sqlite/sqlite-src-3080704/test/fts3aux1.test ('k') | third_party/sqlite/sqlite-src-3080704/test/fts3b.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698