Files
turso/testing/cmdlineshell.test
Pekka Enberg 5251f7a2f8 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.
2024-07-26 09:48:48 +03:00

48 lines
948 B
Tcl
Executable File

#!/usr/bin/env tclsh
set testdir [file dirname $argv0]
source $testdir/tester.tcl
do_execsql_test schema {
.schema
} {{CREATE TABLE users (
id INTEGER PRIMARY KEY,
first_name TEXT,
last_name TEXT,
email TEXT,
phone_number TEXT,
address TEXT,
city TEXT,
state TEXT,
zipcode TEXT,
age INTEGER
);
CREATE TABLE products (
id INTEGER PRIMARY KEY,
name TEXT,
price REAL
);}}
do_execsql_test schema-1 {
.schema users
} {{CREATE TABLE users (
id INTEGER PRIMARY KEY,
first_name TEXT,
last_name TEXT,
email TEXT,
phone_number TEXT,
address TEXT,
city TEXT,
state TEXT,
zipcode TEXT,
age INTEGER
);}}
do_execsql_test schema-2 {
.schema products
} {{CREATE TABLE products (
id INTEGER PRIMARY KEY,
name TEXT,
price REAL
);}}