testing: Fix do_execsql_test() for JSON

The current scheme of combining SQL statements corrupts JSON by dropping
the curly braces. Fix the issue by passing the SQL statement almost as-is
to the database. However, for ".schema" to work, we need to trim extra
whitespace.
This commit is contained in:
Pekka Enberg 2024-07-26 09:30:13 +03:00
parent 0d5b4814ad
commit 5251f7a2f8
2 changed files with 1 additions and 1 deletions

0
testing/cmdlineshell.test Normal file → Executable file
View file

View file

@ -18,7 +18,7 @@ proc run_test {sqlite_exec sql expected_output} {
proc do_execsql_test {test_name sql_statements expected_outputs} {
puts "Running test: $test_name"
set combined_sql [join $sql_statements " "]
set combined_sql [string trim $sql_statements]
set combined_expected_output [join $expected_outputs "\n"]
run_test $::sqlite_exec $combined_sql $combined_expected_output
}