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

Unified Diff: third_party/sqlite/sqlite-src-3080704/test/shell3.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/shell3.test
diff --git a/third_party/sqlite/src/tool/shell3.test b/third_party/sqlite/sqlite-src-3080704/test/shell3.test
similarity index 74%
copy from third_party/sqlite/src/tool/shell3.test
copy to third_party/sqlite/sqlite-src-3080704/test/shell3.test
index d37adff2d31742f26d85c5e29da798dfcfde3249..ce1fd4ecb5d82931fc0dddf5abaa1f2b63a71885 100644
--- a/third_party/sqlite/src/tool/shell3.test
+++ b/third_party/sqlite/sqlite-src-3080704/test/shell3.test
@@ -19,54 +19,28 @@
# shell3-1.*: Basic tests for running SQL statments from command line.
# shell3-2.*: Basic tests for running SQL file from command line.
#
-
-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
- }
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+if {$tcl_platform(platform)=="windows"} {
+ set CLI "sqlite3.exe"
+} else {
+ set CLI "./sqlite3"
}
-
-proc execsql {sql} {
- uplevel [list db eval $sql]
-}
-
-proc catchsql {sql} {
- set rc [catch {uplevel [list db eval $sql]} msg]
- list $rc $msg
+if {![file executable $CLI]} {
+ finish_test
+ return
}
-
-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
-}
-
-file delete -force test.db test.db.journal
+db close
+forcedelete test.db test.db-journal test.db-wal
sqlite3 db test.db
-
#----------------------------------------------------------------------------
# shell3-1.*: Basic tests for running SQL statments from command line.
#
# Run SQL statement from command line
do_test shell3-1.1 {
- file delete -force foo.db
+ forcedelete foo.db
set rc [ catchcmd "foo.db \"CREATE TABLE t1(a);\"" ]
set fexist [file exist foo.db]
list $rc $fexist
@@ -96,7 +70,7 @@ do_test shell3-1.7 {
# Run SQL file from command line
do_test shell3-2.1 {
- file delete -force foo.db
+ forcedelete foo.db
set rc [ catchcmd "foo.db" "CREATE TABLE t1(a);" ]
set fexist [file exist foo.db]
list $rc $fexist
@@ -120,5 +94,4 @@ do_test shell3-2.7 {
catchcmd "foo.db" "CREATE TABLE"
} {1 {Error: incomplete SQL: CREATE TABLE}}
-
-puts "CLI tests completed successfully"
+finish_test
« no previous file with comments | « third_party/sqlite/sqlite-src-3080704/test/shell2.test ('k') | third_party/sqlite/sqlite-src-3080704/test/shell4.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698