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

Unified Diff: third_party/sqlite/src/test/fts3ah.test

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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/test/fts3ag.test ('k') | third_party/sqlite/src/test/fts3al.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/fts3ah.test
diff --git a/third_party/sqlite/src/test/fts3ah.test b/third_party/sqlite/src/test/fts3ah.test
index 1a58e49f4be9ae79cb1fd93cbe871c9b27b0934b..3810ec37b5c8c5bd35683c5537520b6b1f59d299 100644
--- a/third_party/sqlite/src/test/fts3ah.test
+++ b/third_party/sqlite/src/test/fts3ah.test
@@ -1,37 +1,32 @@
-# 2006 October 31 (scaaarey)
+# 2006 October 31
#
-# The author disclaims copyright to this source code.
+# 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
-# here is testing correct handling of excessively long terms.
-#
-# $Id: fts3ah.test,v 1.1 2007/08/20 17:38:42 shess Exp $
+# here is testing correct handling of very long terms.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
-# If SQLITE_ENABLE_FTS3 is defined, omit this file.
+# If SQLITE_ENABLE_FTS3 is not defined, omit this file.
ifcapable !fts3 {
finish_test
return
}
-# Generate a term of len copies of char.
-proc bigterm {char len} {
- for {set term ""} {$len>0} {incr len -1} {
- append term $char
- }
- return $term
-}
-
# Generate a document of bigterms based on characters from the list
# chars.
proc bigtermdoc {chars len} {
set doc ""
foreach char $chars {
- append doc " " [bigterm $char $len]
+ append doc " " [string repeat $char $len]
}
return $doc
}
@@ -41,9 +36,9 @@ set doc1 [bigtermdoc {a b c d} $len]
set doc2 [bigtermdoc {b d e f} $len]
set doc3 [bigtermdoc {a c e} $len]
-set aterm [bigterm a $len]
-set bterm [bigterm b $len]
-set xterm [bigterm x $len]
+set aterm [string repeat a $len]
+set bterm [string repeat b $len]
+set xterm [string repeat x $len]
db eval {
CREATE VIRTUAL TABLE t1 USING fts3(content);
@@ -61,15 +56,15 @@ do_test fts3ah-1.2 {
execsql {SELECT rowid FROM t1 WHERE t1 MATCH $aterm}
} {1 3}
-do_test fts3ah-1.2 {
+do_test fts3ah-1.3 {
execsql {SELECT rowid FROM t1 WHERE t1 MATCH $xterm}
} {}
-do_test fts3ah-1.3 {
+do_test fts3ah-1.4 {
execsql "SELECT rowid FROM t1 WHERE t1 MATCH '$aterm -$xterm'"
} {1 3}
-do_test fts3ah-1.4 {
+do_test fts3ah-1.5 {
execsql "SELECT rowid FROM t1 WHERE t1 MATCH '\"$aterm $bterm\"'"
} {1}
« no previous file with comments | « third_party/sqlite/src/test/fts3ag.test ('k') | third_party/sqlite/src/test/fts3al.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698