CoolFace
Modelpublic

AryaWu/sqlite

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
shellB.test45 linesDownload Raw Back to test
1# 2025-11-122#3# The author disclaims copyright to this source code.  In place of4# a legal notice, here is a blessing:5#6#    May you do good and not evil.7#    May you find forgiveness for yourself and forgive others.8#    May you share freely, never taking more than you give.9#10#***********************************************************************11# TESTRUNNER: shell12#13# Test cases for the command-line shell using the new ".output memory"14# feature.15#16#17 18set testdir [file dirname $argv0]19source $testdir/tester.tcl20set CLI [test_cli_invocation]21 22# Run an instance of the CLI on the file $name.23# Capture the number of test cases and the number of24# errors and increment the counts.25#26proc do_clitest {name} {27  set mapping [list <NAME> $::testdir/$name <CLI> $::CLI]28  set script [string map $mapping {29    catch {exec <CLI> :memory: ".read <NAME>" 2>@stdout} res30    set ntest 031    set nerr 99932    regexp {(\d+) tests? run with (\d+) errors?} $res all ntest nerr33    set_test_counter count [expr {[set_test_counter count]+$ntest-1}]34    set_test_counter errors [expr {[set_test_counter errors]+$nerr}]35    if {$nerr==0} {set res "error count: 0"}36    set res37  }]38  # puts $script39  do_test shellB-$name $script {error count: 0}40}41 42do_clitest modeA.clitest43 44finish_test45