From 5251f7a2f86bf30ac83112310d9e3e16cf28d5fc Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Fri, 26 Jul 2024 09:30:13 +0300 Subject: [PATCH] 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. --- testing/cmdlineshell.test | 0 testing/tester.tcl | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 testing/cmdlineshell.test diff --git a/testing/cmdlineshell.test b/testing/cmdlineshell.test old mode 100644 new mode 100755 diff --git a/testing/tester.tcl b/testing/tester.tcl index e757d4a6e..5a9eaab30 100644 --- a/testing/tester.tcl +++ b/testing/tester.tcl @@ -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 }