Index: Tests/common.eagle ================================================================== --- Tests/common.eagle +++ Tests/common.eagle @@ -125,18 +125,21 @@ # # NOTE: For native builds, return the platform name corresponding to # the test machine architecture; otherwise, return an empty # string. # - return [expr {$native ? [machineToPlatform $::test_machine] : ""}] + return [expr { + $native ? [machineToPlatform $::test_machine] : "" + }] } elseif {[info exists ::tcl_platform(machine)]} then { # # NOTE: For native builds, return the platform name corresponding to # the machine architecture; otherwise, return an empty string. # - return [expr {$native ? \ - [machineToPlatform $::tcl_platform(machine)] : ""}] + return [expr { + $native ? [machineToPlatform $::tcl_platform(machine)] : "" + }] } else { # # NOTE: No machine architecture is available, return an empty string. # return "" @@ -920,11 +923,11 @@ # and the [checkForSQLite] procedure has been called to probe for # the SQLite native library; otherwise, this procedure will simply # always return zero. # return [expr { - [haveConstraint System.Data.SQLite] && [haveConstraint SQLite] + [haveConstraint System.Data.SQLite] && [haveConstraint SQLite] }] } proc matchMachine { platform } { # @@ -1342,30 +1345,38 @@ # present in that database. # upvar 1 $varName db # - # NOTE: Execute the SQL query against the sqlite_master table to check if - # the named table is present and return non-zero if it is. + # NOTE: Use the sqlite_master table to determine if the named table is + # present in the database. # - return [expr {[sql execute -execute scalar $db \ - "SELECT COUNT(*) FROM sqlite_master WHERE type = 'table' AND name = ?;" \ - [list param1 String $name]] > 0}] + set sql { + SELECT COUNT(*) FROM sqlite_master WHERE type = 'table' AND name = ?; + } + + # + # NOTE: Return non-zero if the named table is present. + # + return [expr { + [sql execute -execute scalar $db $sql [list param1 String $name]] > 0 + }] } proc trimSql { sql } { return [regsub -all -- {\s+} [string trim $sql] " "] } - proc executeSql { sql {execute none} {fileName ""} } { + proc executeSql { sql {execute none} {format none} {fileName ""} } { if {[string length $fileName] == 0} then {set fileName :memory:} - setupDb $fileName "" "" "" "" "" false false false false memDb + setupDb $fileName "" "" "" "" "" false false false false try { - return [sql execute -execute $execute $memDb $sql] + return [uplevel 1 [list \ + sql execute -execute $execute -format $format $db $sql]] } finally { - cleanupDb $fileName memDb false false + cleanupDb $fileName db false false false } } proc setupDb { fileName {mode ""} {dateTimeFormat ""} {dateTimeKind ""} {flags ""}