mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
New test cases for the ".dump" and ".mode insert" commands of the shell.
FossilOrigin-Name: dfce8569765614462a3952d1761c10d579984665
This commit is contained in:
@ -691,4 +691,33 @@ do_test shell1-3-28.1 {
|
||||
".log stdout\nSELECT coalesce(sqlite_log(123,'hello'),'456');"
|
||||
} "0 {(123) hello\n456}"
|
||||
|
||||
# Test the output of the ".dump" command
|
||||
#
|
||||
do_test shell1-4.1 {
|
||||
db eval {
|
||||
CREATE TABLE t1(x);
|
||||
INSERT INTO t1 VALUES(null), (1), (2.25), ('hello'), (x'807f');
|
||||
}
|
||||
catchcmd test.db {.dump}
|
||||
} {0 {PRAGMA foreign_keys=OFF;
|
||||
BEGIN TRANSACTION;
|
||||
CREATE TABLE t1(x);
|
||||
INSERT INTO "t1" VALUES(NULL);
|
||||
INSERT INTO "t1" VALUES(1);
|
||||
INSERT INTO "t1" VALUES(2.25);
|
||||
INSERT INTO "t1" VALUES('hello');
|
||||
INSERT INTO "t1" VALUES(X'807F');
|
||||
COMMIT;}}
|
||||
|
||||
# Test the output of ".mode insert"
|
||||
#
|
||||
do_test shell1-4.2 {
|
||||
catchcmd test.db ".mode insert t1\nselect * from t1;"
|
||||
} {0 {INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES(1);
|
||||
INSERT INTO t1 VALUES(2.25);
|
||||
INSERT INTO t1 VALUES('hello');
|
||||
INSERT INTO t1 VALUES(X'807f');}}
|
||||
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user