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

Unified Diff: third_party/sqlite/src/test/fts3ao.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
« no previous file with comments | « third_party/sqlite/src/test/fts3aj.test ('k') | third_party/sqlite/src/test/fts3atoken.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/fts3ao.test
diff --git a/third_party/sqlite/src/test/fts3ao.test b/third_party/sqlite/src/test/fts3ao.test
index cd9df01eb44cd7309ebc2b015d6a99d8ad56a408..60f0aa7d90e49e63aa8dc282626cfb267e63642a 100644
--- a/third_party/sqlite/src/test/fts3ao.test
+++ b/third_party/sqlite/src/test/fts3ao.test
@@ -111,7 +111,7 @@ do_test fts3ao-2.12 {
# be run on an initially empty db.
#
db close
-file delete -force test.db test.db-journal
+forcedelete test.db test.db-journal
sqlite3 db test.db
do_test fts3ao-3.1 {
@@ -136,7 +136,7 @@ do_test fts3ao-3.2 {
# Test that it is possible to rename an fts3 table in an attached
# database.
#
-file delete -force test2.db test2.db-journal
+forcedelete test2.db test2.db-journal
do_test fts3ao-3.1 {
execsql {
@@ -200,6 +200,9 @@ do_test fts3ao-4.7 {
SELECT * FROM t5;
}
} {{the quick brown fox} {jumped over the} {lazy dog}}
+do_execsql_test fts3ao-4.8 {
+ SELECT snippet(t5, '[', ']') FROM t5 WHERE t5 MATCH 'the'
+} {{[the] quick brown fox} {jumped over [the]}}
# Test that it is possible to rename an FTS4 table. Renaming an FTS4 table
# involves renaming the extra %_docsize and %_stat tables.
@@ -216,5 +219,32 @@ do_execsql_test 5.2 {
SELECT count(*) FROM sqlite_master WHERE name LIKE 't8%';
} {0 6}
-finish_test
+# At one point this was causing a memory leak.
+#
+foreach {tn sql} {
+ 1 {}
+ 2 { INSERT INTO ft(ft) VALUES('merge=2,2'); }
+} {
+ reset_db
+ do_execsql_test 6.$tn.1 "
+ CREATE TABLE t1(x);
+ CREATE VIRTUAL TABLE ft USING fts3;
+ INSERT INTO ft VALUES('hello world');
+ $sql
+ "
+
+ db close
+ sqlite3 db test.db
+ do_execsql_test 6.$tn.2 { SELECT * FROM t1 } {}
+
+ do_test 6.$tn.3 {
+ sqlite3 db2 test.db
+ db2 eval { DROP TABLE t1 }
+ db2 close
+ set stmt [sqlite3_prepare db { SELECT * FROM ft } -1 dummy]
+ sqlite3_finalize $stmt
+ } {SQLITE_OK}
+ db close
+}
+finish_test
« no previous file with comments | « third_party/sqlite/src/test/fts3aj.test ('k') | third_party/sqlite/src/test/fts3atoken.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698