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

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

Issue 883353008: [sql] Import reference version of SQLite 3.8.7.4. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hold back encoding change which is messing up patch. Created 5 years, 11 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/shell2.test
diff --git a/third_party/sqlite/sqlite-src-3070603/tool/shell2.test b/third_party/sqlite/sqlite-src-3080704/test/shell2.test
similarity index 82%
copy from third_party/sqlite/sqlite-src-3070603/tool/shell2.test
copy to third_party/sqlite/sqlite-src-3080704/test/shell2.test
index b63fafc3656e666e62566527332f142aa92721d9..def574c76c16d82c405aaead3e9a3adbe2505f42 100644
--- a/third_party/sqlite/sqlite-src-3070603/tool/shell2.test
+++ b/third_party/sqlite/sqlite-src-3080704/test/shell2.test
@@ -18,44 +18,19 @@
#
# shell2-1.*: Misc. test of various tickets and reported errors.
#
-
-package require sqlite3
-
-set CLI "./sqlite3"
-
-proc do_test {name cmd expected} {
- puts -nonewline "$name ..."
- set res [uplevel $cmd]
- if {$res eq $expected} {
- puts Ok
- } else {
- puts Error
- puts " Got: $res"
- puts " Expected: $expected"
- exit
- }
-}
-
-proc execsql {sql} {
- uplevel [list db eval $sql]
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+if {$tcl_platform(platform)=="windows"} {
+ set CLI "sqlite3.exe"
+} else {
+ set CLI "./sqlite3"
}
-
-proc catchsql {sql} {
- set rc [catch {uplevel [list db eval $sql]} msg]
- list $rc $msg
-}
-
-proc catchcmd {db {cmd ""}} {
- global CLI
- set out [open cmds.txt w]
- puts $out $cmd
- close $out
- set line "exec $CLI $db < cmds.txt"
- set rc [catch { eval $line } msg]
- list $rc $msg
+if {![file executable $CLI]} {
+ finish_test
+ return
}
-
-file delete -force test.db test.db.journal
+db close
+forcedelete test.db test.db-journal test.db-wal
sqlite3 db test.db
@@ -67,7 +42,7 @@ sqlite3 db test.db
# Reported on mailing list by Ken Zalewski.
# Ticket [aeff892c57].
do_test shell2-1.1.1 {
- file delete -force foo.db
+ forcedelete foo.db
set rc [ catchcmd "-batch foo.db" "CREATE TABLE t1(a);" ]
set fexist [file exist foo.db]
list $rc $fexist
@@ -106,7 +81,7 @@ do_test shell2-1.3 {
# Test with echo off
# NB. whitespace is important
do_test shell2-1.4.1 {
- file delete -force foo.db
+ forcedelete foo.db
catchcmd "foo.db" {CREATE TABLE foo(a);
INSERT INTO foo(a) VALUES(1);
SELECT * FROM foo;}
@@ -115,7 +90,7 @@ SELECT * FROM foo;}
# Test with echo on using command line option
# NB. whitespace is important
do_test shell2-1.4.2 {
- file delete -force foo.db
+ forcedelete foo.db
catchcmd "-echo foo.db" {CREATE TABLE foo(a);
INSERT INTO foo(a) VALUES(1);
SELECT * FROM foo;}
@@ -127,7 +102,7 @@ SELECT * FROM foo;
# Test with echo on using dot command
# NB. whitespace is important
do_test shell2-1.4.3 {
- file delete -force foo.db
+ forcedelete foo.db
catchcmd "foo.db" {.echo ON
CREATE TABLE foo(a);
INSERT INTO foo(a) VALUES(1);
@@ -141,7 +116,7 @@ SELECT * FROM foo;
# turning off mid- processing.
# NB. whitespace is important
do_test shell2-1.4.4 {
- file delete -force foo.db
+ forcedelete foo.db
catchcmd "foo.db" {.echo ON
CREATE TABLE foo(a);
.echo OFF
@@ -155,7 +130,7 @@ SELECT * FROM foo;}
# multiple commands per line.
# NB. whitespace is important
do_test shell2-1.4.5 {
- file delete -force foo.db
+ forcedelete foo.db
catchcmd "foo.db" {.echo ON
CREATE TABLE foo1(a);
INSERT INTO foo1(a) VALUES(1);
@@ -180,13 +155,14 @@ SELECT * FROM foo1;
2
SELECT * FROM foo2;
1
-2}}
+2
+}}
# Test with echo on and headers on using dot command and
# multiple commands per line.
# NB. whitespace is important
do_test shell2-1.4.6 {
- file delete -force foo.db
+ forcedelete foo.db
catchcmd "foo.db" {.echo ON
.headers ON
CREATE TABLE foo1(a);
@@ -217,6 +193,7 @@ a
SELECT * FROM foo2;
b
1
-2}}
+2
+}}
-puts "CLI tests completed successfully"
+finish_test
« no previous file with comments | « third_party/sqlite/sqlite-src-3080704/test/shell1.test ('k') | third_party/sqlite/sqlite-src-3080704/test/shell3.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698