mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Update the sessions branch with all the latest changes from trunk.
FossilOrigin-Name: 0f347fbfc7d8821f56f1ae0d1a9472a375631e65
This commit is contained in:
@ -474,7 +474,6 @@ proc incr_ntest {} {
|
||||
# Invoke the do_test procedure to run a single test
|
||||
#
|
||||
proc do_test {name cmd expected} {
|
||||
|
||||
global argv cmdlinearg
|
||||
|
||||
fix_testname name
|
||||
@ -505,11 +504,24 @@ proc do_test {name cmd expected} {
|
||||
if {[catch {uplevel #0 "$cmd;\n"} result]} {
|
||||
puts "\nError: $result"
|
||||
fail_test $name
|
||||
} elseif {[string compare $result $expected]} {
|
||||
puts "\nExpected: \[$expected\]\n Got: \[$result\]"
|
||||
fail_test $name
|
||||
} else {
|
||||
puts " Ok"
|
||||
if {[regexp {^~?/.*/$} $expected]} {
|
||||
if {[string index $expected 0]=="~"} {
|
||||
set re [string range $expected 2 end-1]
|
||||
set ok [expr {![regexp $re $result]}]
|
||||
} else {
|
||||
set re [string range $expected 1 end-1]
|
||||
set ok [regexp $re $result]
|
||||
}
|
||||
} else {
|
||||
set ok [expr {[string compare $result $expected]==0}]
|
||||
}
|
||||
if {!$ok} {
|
||||
puts "\nExpected: \[$expected\]\n Got: \[$result\]"
|
||||
fail_test $name
|
||||
} else {
|
||||
puts " Ok"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
puts " Omitted"
|
||||
@ -518,6 +530,16 @@ proc do_test {name cmd expected} {
|
||||
flush stdout
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
proc filepath_normalize {p} {
|
||||
# test cases should be written to assume "unix"-like file paths
|
||||
if {$::tcl_platform(platform)!="unix"} {
|
||||
|
Reference in New Issue
Block a user