1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-10-23 21:49:02 +03:00

Update test cases to work with the new box format and with --quote relaxed.

FossilOrigin-Name: e3f442d08f455e0aa260cc8db4922a5f611e17afe71b0bb251328ab4b3ad46ca
This commit is contained in:
drh
2025-12-06 11:02:14 +00:00
parent cff66960fd
commit 5fb9d599ed
12 changed files with 217 additions and 216 deletions

View File

@@ -707,16 +707,6 @@ BCC = $(BCC) -MT
!ENDIF
# Define -DNDEBUG to compile without debugging (i.e., for production usage)
# Omitting the define will cause extra debugging code to be inserted and
# includes extra comments when "EXPLAIN stmt" is used.
#
!IF $(DEBUG)==0
TCC = $(TCC) -DNDEBUG
BCC = $(BCC) -DNDEBUG
RCC = $(RCC) -DNDEBUG
!ENDIF
!IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1

View File

@@ -1,5 +1,5 @@
C New\stext\srendering\sstyle\sof\sQRF_TEXT_Relaxed.
D 2025-12-06T10:07:15.670
C Update\stest\scases\sto\swork\swith\sthe\snew\sbox\sformat\sand\swith\s--quote\srelaxed.
D 2025-12-06T11:02:14.503
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -18,7 +18,7 @@ F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821
F auto.def 44a0d1bf09d78355fc88251ccbf8e64e6341fd89c11de68a01c3645e53a2bade
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
F autoconf/Makefile.in 306f500fce8cae9e1af9459f1ac7fe89ce46999594ef3fdc62dc9d7d651fb091
F autoconf/Makefile.msc a362297e3b5c61ef90b3afbe90cbaa28dd540e580b59fa9d1a4ad6dff9dcdc55
F autoconf/Makefile.msc 9cac28630acafc033e04804213f2b74dfa2cabdde127b2ba009630adbd75b943
F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136
F autoconf/README.txt b749816b8452b3af994dc6d607394bef3df1736d7e09359f1087de8439a52807
F autoconf/auto.def 3d994f3a9cc9b712dbce92a5708570ddcf3b988141b6eb738f2ed16127a9f0ac
@@ -737,7 +737,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
F src/resolve.c 8d53771eb51a4ab5f970150c3a70969d8db79cd04a8774c2d296bbcf471a0dd0
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
F src/select.c 344518c1bba9c4636bf651b7642304abd2e7075ba35feb4bae42a51e5efe991f
F src/shell.c.in 09585992a8752390fab97ade0a6136468180ad991fe152b1c140e2aa7283e82f
F src/shell.c.in c5646a3c7aa844bd4981c3028a2e412fd9d513f848aa884fbf5cda7e0f3fb531
F src/sqlite.h.in 706cacea5308b0244fb6cec92e08310fb427a125375c64137cc1f878ae4cf5c0
F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
F src/sqlite3ext.h 5d5330f5f8461f5ce74960436ddcfa53ecd09c2b8b23901e22ae38aec3243998
@@ -745,7 +745,7 @@ F src/sqliteInt.h af67bc95fa6b66cd3c7f3d18d2d040ad386e4cbb02965ee318cc721ee9d5fa
F src/sqliteLimit.h 7e705474d59912388832cc5465edbc0dbb552872e23452812846e90d280987f3
F src/status.c 7565d63a79aa2f326339a24a0461a60096d0bd2bce711fefb50b5c89335f3592
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
F src/tclsqlite.c cf5d43c1549e32804bf8ac1eb2478a695caaee688a7b29e8db1be33206b600b4
F src/tclsqlite.c 1411438584e8e08c0959e6341acb0487039de662dab223ae0fef26d361211b6e
F src/tclsqlite.h 614b3780a62522bc9f8f2b9fb22689e8009958e7aa77e572d0f3149050af348a
F src/test1.c 0e71fbcb484a271564e98e0158192c28c24f5521594218c3ba48bcb4cf634f91
F src/test2.c 62f0830958f9075692c29c6de51b495ae8969e1bef85f239ffcd9ba5fb44a5ff
@@ -1441,7 +1441,7 @@ F test/mmap4.test 2e2b4e32555b58da15176e6fe750f17c9dcf7f93
F test/mmapcorrupt.test 470fb44fe92e99c1d23701d156f8c17865f5b027063c9119dcfdb842791f4465
F test/mmapfault.test d4c9eff9cd8c2dc14bc43e71e042f175b0a26fe3
F test/mmapwarm.test 2272005969cd17a910077bd5082f70bc1fefad9a875afec7fc9af483898ecaf3
F test/modeA.clitest e0c63c28e2651dd322e21de683fec7d247028b80f7a753663244ba0087215dc8
F test/modeA.clitest dc575548084eaa9b0214c4a8d544a3755e3befb08c657fd866047f16c85ffa37
F test/multiplex.test d74c034e52805f6de8cc5432cef8c9eb774bb64ec29b83a22effc8ca4dac1f08
F test/multiplex2.test 580ca5817c7edbe4cc68fa150609c9473393003a
F test/multiplex3.test fac575e0b1b852025575a6a8357701d80933e98b5d2fe6d35ddaa68f92f6a1f7
@@ -1511,12 +1511,12 @@ F test/printf2.test 3f55c1871a5a65507416076f6eb97e738d5210aeda7595a74ee895f2224c
F test/progress.test ebab27f670bd0d4eb9d20d49cef96e68141d92fb
F test/ptrchng.test ef1aa72d6cf35a2bbd0869a649b744e9d84977fc
F test/pushdown.test 46a626ef1c0ca79b85296ff2e078b9da20a50e9b804b38f441590c3987580ddd
F test/qrf01.test 48c86e90f606739e67b73937babb662ef0edf1ede06954489c588815fa17b560
F test/qrf01.test 5e4128aa6b20f07b2c96b5969736912f76f5d08263244a803d4d2103f6105a4b
F test/qrf02.test 39b4afdc000bedccdafc0aecf17638df67a67aaa2d2942865ae6abcc48ba0e92
F test/qrf03.test ad7fa339fb46b26b08625f3a77a4827bdee9f0dad402d8ddc1fcb8f05aa64a54
F test/qrf03.test e7efe46d204671726b4707585126cd78d107368de4a7d0c7b8d5157cdd8624ed
F test/qrf04.test 0894692c998d2401dcc33449c02051b503ecce0c94217be54fb007c82d2d1379
F test/qrf05.test 8ade5bfa7ef0b448e531687203fa8ae9ef41f1d7e4c11d5ba0c4846af75b13d5
F test/qrf06.test 3907f81c79fd884802cc7552d4a07fd8d73c381ade9d5108e6d7f56fd962b99b
F test/qrf06.test cd7d0f0e2904904ab88141630a8fff5718ef7e3cc23e5a9c519cf29bb0919d89
F test/queryonly.test 5f653159e0f552f0552d43259890c1089391dcca
F test/quick.test 1681febc928d686362d50057c642f77a02c62e57
F test/quickcheck.test a4b7e878cd97e46108291c409b0bf8214f29e18fddd68a42bc5c1375ad1fb80a
@@ -1610,8 +1610,8 @@ F test/sharedA.test 64bdd21216dda2c6a3bd3475348ccdc108160f34682c97f2f51c19fc0e21
F test/sharedB.test 1a84863d7a2204e0d42f2e1606577c5e92e4473fa37ea0f5bdf829e4bf8ee707
F test/shared_err.test 32634e404a3317eeb94abc7a099c556a346fdb8fb3858dbe222a4cbb8926a939
F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304
F test/shell1.test b49a89913c194c37ca10c9ded1b6b6866506104621c6cc599e557e4cb5ed8cc2
F test/shell2.test 103140814bdc7508aa41dd3462413cbc4aa84b4261112cb8d501d74275cb7d48
F test/shell1.test fc7d2592ca2236cf656f207cf2a69cef3383abff8abd78675e44c8c2d3455086
F test/shell2.test 9d55aa53ca36c6889dedf5a23d849793afbd2dbe62d512ce066cb293a8a66a88
F test/shell3.test 840192774cc4edf7653520c0434a311c7477b9bc324abbc7bd2887915792fa8c
F test/shell4.test e25580a792b7b54560c3a76b6968bd8189261f38979fe28e6bc6312c5db280db
F test/shell5.test 7a249400bb2af59ac8524f357f8cf2844a62b6ac5ff8ecd69b045ceb688700ae
@@ -1619,7 +1619,7 @@ F test/shell6.test e3b883b61d4916b6906678a35f9d19054861123ad91b856461e0a456273bd
F test/shell7.test 43fd8e511c533bab5232e95c7b4be93b243451709e89582600d4b6e67693d5c3
F test/shell8.test 641cf21a99c59404c24e3062923734951c4099a6b6b6520de00cf7a1249ee871
F test/shell9.test 8742a5b390cdcef6369f5aa223e415aa4255a4129ef249b177887dc635a87209
F test/shellA.test 4f57da76ed1f6d4a4eba0b2a27cdef4c756f1da2c813dc7034079e4df493110f
F test/shellA.test 5fa0bdb7a19b0c1ba32649eab3eca0f7164bd9d33d391fff17586abcbc6c6e18
F test/shellB.test de879b1ea7c25daf1a06b2c882b45a5d002e6580c81c57169ce47084cc6afb6b
F test/shmlock.test 9f1f729a7fe2c46c88b156af819ac9b72c0714ac6f7246638a73c5752b5fd13c
F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
@@ -2184,8 +2184,8 @@ F tool/version-info.c 33d0390ef484b3b1cb685d59362be891ea162123cea181cb8e6d2cf6dd
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 8c1ca30707c36f074dad29556df4176a74aa573491bb4aad973789aee5ad80da
R 81b5ef778830cc60943eae42e77827ea
P d2049bffe6674b8840663b0e5f404a040b715640c87f022517cf11546548fda3
R e97d553da9f54d493dfdd1ccf5eb3ae4
U drh
Z 8f661d440d11fe3a4df6fb112e8f304a
Z 84fa93b37bf781cb02b209931a6e3fae
# Remove this line to create a well-formed Fossil manifest.

View File

@@ -1 +1 @@
d2049bffe6674b8840663b0e5f404a040b715640c87f022517cf11546548fda3
e3f442d08f455e0aa260cc8db4922a5f611e17afe71b0bb251328ab4b3ad46ca

View File

@@ -1642,6 +1642,7 @@ static void modeChange(ShellState *p, unsigned char eMode){
modeFree(&p->mode);
modeChange(p, MODE_QBox);
p->mode.bAutoScreenWidth = 1;
p->mode.spec.eText = QRF_TEXT_Relaxed;
p->mode.spec.nCharLimit = 300;
p->mode.spec.nLineLimit = 5;
p->mode.spec.bTextJsonb = QRF_Yes;
@@ -3207,6 +3208,7 @@ static int shell_exec(
}
if( spec.eBlob==QRF_BLOB_Auto ){
switch( spec.eText ){
case QRF_TEXT_Relaxed: /* fall through */
case QRF_TEXT_Sql: spec.eBlob = QRF_BLOB_Sql; break;
case QRF_TEXT_Json: spec.eBlob = QRF_BLOB_Json; break;
default: spec.eBlob = QRF_BLOB_Text; break;

View File

@@ -2193,13 +2193,13 @@ static int dbQrf(SqliteDb *pDb, int objc, Tcl_Obj *const*objv){
** thrid element of the array when processing --text */
static const char *azText[] = { "off", "on",
"auto", "csv", "html",
"json", "plain", "sql",
"tcl", "relaxed", 0
"json", "plain", "relaxed",
"sql", "tcl", 0
};
static unsigned char aTextMap[] = {
QRF_TEXT_Auto, QRF_TEXT_Csv, QRF_TEXT_Html,
QRF_TEXT_Json, QRF_TEXT_Plain, QRF_TEXT_Sql,
QRF_TEXT_Tcl, QRF_TEXT_Relaxed
QRF_TEXT_Json, QRF_TEXT_Plain, QRF_TEXT_Relaxed,
QRF_TEXT_Sql, QRF_TEXT_Tcl
};
int txt;
int k = zArg[2]=='e';

View File

@@ -24,28 +24,28 @@ INSERT INTO t1 SELECT d,e,a,b,c FROM t1;
.output memory
SELECT * FROM t1;
.output --verify END
┌─────┬───────┬───────┬───────┬───────┐
╭─────┬───────┬───────┬───────┬───────╮
│ a │ b │ c │ d │ e │
├─────┼───────┼───────┼───────┼───────┤
╞═════╪═══════╪═══════╪═══════╪═══════╡
│ 1 │ 2.5 │ three │ DD │ │
│ 2.5 │ three │ DD │ │ 1 │
│ DD │ │ 1 │ 2.5 │ three │
│ │ 1 │ 2.5 │ three │ DD │
└─────┴───────┴───────┴───────┴───────┘
╰─────┴───────┴───────┴───────┴───────╯
END
.output memory
.mode --null xyz
SELECT * FROM t1;
.output --verify END
┌─────┬───────┬───────┬───────┬───────┐
╭─────┬───────┬───────┬───────┬───────╮
│ a │ b │ c │ d │ e │
├─────┼───────┼───────┼───────┼───────┤
╞═════╪═══════╪═══════╪═══════╪═══════╡
│ 1 │ 2.5 │ three │ DD │ xyz │
│ 2.5 │ three │ DD │ xyz │ 1 │
│ DD │ xyz │ 1 │ 2.5 │ three │
│ xyz │ 1 │ 2.5 │ three │ DD │
└─────┴───────┴───────┴───────┴───────┘
╰─────┴───────┴───────┴───────┴───────╯
END
.output memory --error-prefix "Error:"

View File

@@ -24,63 +24,72 @@ do_execsql_test 1.0 {
do_test 1.10 {
set result "\n[db format {SELECT * FROM t1}]"
} {
┌──────┬─────┬───────┐
╭──────┬─────┬───────╮
│ a │ b │ c │
├──────┼─────┼───────┤
│ 1 │ 2.5 │ three │
╞══════╪═════╪═══════╡
│ 1 │ 2.5 │ three │
│ BLOB │ │ Ἀμήν │
└──────┴─────┴───────┘
╰──────┴─────┴───────╯
}
do_test 1.11a {
set result "\n[db format -title off {SELECT * FROM t1}]"
} {
┌──────┬─────┬───────┐
│ 1 │ 2.5 │ three │
╭──────┬─────┬───────╮
│ 1 │ 2.5 │ three │
│ BLOB │ │ Ἀμήν │
└──────┴─────┴───────┘
╰──────┴─────┴───────╯
}
do_test 1.11b {
set result "\n[db format -text sql {SELECT * FROM t1}]"
} {
┌─────────────┬─────┬─────────┐
╭─────────────┬─────┬─────────╮
│ a │ b │ c │
├─────────────┼─────┼─────────┤
│ 1 │ 2.5 │ 'three' │
╞═════════════╪═════╪═════════╡
│ 1 │ 2.5 │ 'three' │
│ x'424c4f42' │ │ 'Ἀμήν' │
└─────────────┴─────┴─────────┘
╰─────────────┴─────┴─────────╯
}
do_test 1.11c {
set result "\n[db format -text sql -border off {SELECT * FROM t1}]"
} {
a │ b │ c
─────────────┼─────┼─────────
═════════════╪═════╪═════════
1 │ 2.5 │ 'three'
x'424c4f42' │ │ 'Ἀμήν'
}
do_test 1.11d {
set result "\n[db format -text relaxed -blob sql -border off \
{SELECT * FROM t1}]"
} {
a │ b │ c
═════════════╪═════╪═══════
1 │ 2.5 │ three
x'424c4f42' │ │ Ἀμήν
}
do_test 1.12 {
set result "\n[db format -text csv {SELECT * FROM t1}]"
} {
┌────────────────────┬─────┬────────┐
╭────────────────────┬─────┬────────╮
│ a │ b │ c │
├────────────────────┼─────┼────────┤
│ 1 │ 2.5 │ three │
╞════════════════════╪═════╪════════╡
│ 1 │ 2.5 │ three │
│ "\102\114\117\102" │ │ "Ἀμήν" │
└────────────────────┴─────┴────────┘
╰────────────────────┴─────┴────────╯
}
do_test 1.13 {
set result "\n[db format -text csv -blob hex {SELECT * FROM t1}]"
} {
┌──────────┬─────┬────────┐
╭──────────┬─────┬────────╮
│ a │ b │ c │
├──────────┼─────┼────────┤
│ 1 │ 2.5 │ three │
╞══════════╪═════╪════════╡
│ 1 │ 2.5 │ three │
│ 424c4f42 │ │ "Ἀμήν" │
└──────────┴─────┴────────┘
╰──────────┴─────┴────────╯
}
do_test 1.14 {
catch {db format -text unk -blob hex {SELECT * FROM t1}} res
set res
} {bad -text "unk": must be auto, csv, html, json, plain, sql, or tcl}
} {bad -text "unk": must be auto, csv, html, json, plain, relaxed, sql, or tcl}
do_test 1.15 {
catch {db format -text sql -blob unk {SELECT * FROM t1}} res
set res
@@ -94,12 +103,12 @@ do_test 1.16 {
do_test 1.20 {
set result "\n[db format -style box {SELECT * FROM t1}]"
} {
┌──────┬─────┬───────┐
╭──────┬─────┬───────╮
│ a │ b │ c │
├──────┼─────┼───────┤
│ 1 │ 2.5 │ three │
╞══════╪═════╪═══════╡
│ 1 │ 2.5 │ three │
│ BLOB │ │ Ἀμήν │
└──────┴─────┴───────┘
╰──────┴─────┴───────╯
}
do_test 1.30 {
@@ -144,7 +153,7 @@ do_test 1.34 {
{SELECT * FROM t1}]"
} {
a │ b │ c
──────┼─────┼───────
══════╪═════╪═══════
1 │ 2.5 │ three
BLOB │ │ Ἀμήν
}
@@ -154,7 +163,7 @@ do_test 1.35 {
{SELECT * FROM t1}]"
} {
a │ b │ c
────┼───┼─────
════╪═══╪═════
1│2.5│three
BLOB│ │Ἀμήν
}
@@ -336,7 +345,7 @@ x'424c4f42'|NULL|'Ἀμήν'
do_test 1.118 {
set rc [catch {db format -style list -title unk {SELECT * FROM t1}} res]
lappend rc $res
} {1 {bad -title "unk": must be off, on, auto, csv, html, json, plain, sql, or tcl}}
} {1 {bad -title "unk": must be off, on, auto, csv, html, json, plain, relaxed, sql, or tcl}}
do_test 1.120 {
@@ -377,86 +386,86 @@ do_test 2.1 {
set result "\n[db format -widths {5 -5 19} -wordwrap on \
{SELECT * FROM t1}]"
} {
┌───────┬───────┬─────────────────────┐
╭───────┬───────┬─────────────────────╮
│ a │ b │ c │
├───────┼───────┼─────────────────────┤
│ 1 │ 2 │ The quick fox jumps │
╞═══════╪═══════╪═════════════════════╡
│ 1 │ 2 │ The quick fox jumps │
│ │ │ over the lazy brown │
│ │ │ dog. │
└───────┴───────┴─────────────────────┘
╰───────┴───────┴─────────────────────╯
}
do_test 2.2 {
set result "\n[db format -widths {5 -5 19} -wordwrap off \
{SELECT * FROM t1}]"
} {
┌───────┬───────┬─────────────────────┐
╭───────┬───────┬─────────────────────╮
│ a │ b │ c │
├───────┼───────┼─────────────────────┤
│ 1 │ 2 │ The quick fox jumps │
╞═══════╪═══════╪═════════════════════╡
│ 1 │ 2 │ The quick fox jumps │
│ │ │ over the lazy brown │
│ │ │ dog. │
└───────┴───────┴─────────────────────┘
╰───────┴───────┴─────────────────────╯
}
do_test 2.3 {
set result "\n[db format -widths {5 -5 18} -wordwrap on \
{SELECT * FROM t1}]"
} {
┌───────┬───────┬────────────────────┐
╭───────┬───────┬────────────────────╮
│ a │ b │ c │
├───────┼───────┼────────────────────┤
│ 1 │ 2 │ The quick fox │
╞═══════╪═══════╪════════════════════╡
│ 1 │ 2 │ The quick fox │
│ │ │ jumps over the │
│ │ │ lazy brown dog. │
└───────┴───────┴────────────────────┘
╰───────┴───────┴────────────────────╯
}
do_test 2.4 {
set result "\n[db format -widths {5 -5 -18} -wordwrap on \
{SELECT * FROM t1}]"
} {
┌───────┬───────┬────────────────────┐
╭───────┬───────┬────────────────────╮
│ a │ b │ c │
├───────┼───────┼────────────────────┤
│ 1 │ 2 │ The quick fox │
╞═══════╪═══════╪════════════════════╡
│ 1 │ 2 │ The quick fox │
│ │ │ jumps over the │
│ │ │ lazy brown dog. │
└───────┴───────┴────────────────────┘
╰───────┴───────┴────────────────────╯
}
do_test 2.5 {
set result "\n[db format -widths {5 -5 19} -wordwrap off \
{SELECT * FROM t1}]"
} {
┌───────┬───────┬─────────────────────┐
╭───────┬───────┬─────────────────────╮
│ a │ b │ c │
├───────┼───────┼─────────────────────┤
│ 1 │ 2 │ The quick fox jumps │
╞═══════╪═══════╪═════════════════════╡
│ 1 │ 2 │ The quick fox jumps │
│ │ │ over the lazy brown │
│ │ │ dog. │
└───────┴───────┴─────────────────────┘
╰───────┴───────┴─────────────────────╯
}
do_test 2.6 {
set result "\n[db format -widths {5 -5 18} -wordwrap off \
{SELECT * FROM t1}]"
} {
┌───────┬───────┬────────────────────┐
╭───────┬───────┬────────────────────╮
│ a │ b │ c │
├───────┼───────┼────────────────────┤
│ 1 │ 2 │ The quick fox jump │
╞═══════╪═══════╪════════════════════╡
│ 1 │ 2 │ The quick fox jump │
│ │ │ s over the lazy br │
│ │ │ own dog. │
└───────┴───────┴────────────────────┘
╰───────┴───────┴────────────────────╯
}
do_test 2.7 {
set result "\n[db format -widths {5 5 18} -wordwrap yes \
-align {left center right} -titlealign right \
{SELECT * FROM t1}]"
} {
┌───────┬───────┬────────────────────┐
╭───────┬───────┬────────────────────╮
│ a │ b │ c │
├───────┼───────┼────────────────────┤
╞═══════╪═══════╪════════════════════╡
│ 1 │ 2 │ The quick fox │
│ │ │ jumps over the │
│ │ │ lazy brown dog. │
└───────┴───────┴────────────────────┘
╰───────┴───────┴────────────────────╯
}
do_test 2.8 {
set result "\n[db format -widths {5 8 11} -wordwrap yes \
@@ -464,15 +473,15 @@ do_test 2.8 {
-defaultalign right \
{SELECT * FROM t1}]"
} {
┌───────┬──────────┬─────────────┐
╭───────┬──────────┬─────────────╮
│ a │ b │ c │
├───────┼──────────┼─────────────┤
╞═══════╪══════════╪═════════════╡
│ 1 │ 2 │ The quick │
│ │ │ fox jumps │
│ │ │ over the │
│ │ │ lazy brown │
│ │ │ dog. │
└───────┴──────────┴─────────────┘
╰───────┴──────────┴─────────────╯
}
do_test 2.9 {
catch {db format -align {auto xyz 123} {SELECT * FROM t1}} res
@@ -496,27 +505,27 @@ do_test 2.31 {
set result "\n[db format -widths {5 -5 18} -wordwrap on \
{SELECT * FROM t1}]"
} {
┌───────┬───────┬────────────────────┐
╭───────┬───────┬────────────────────╮
│ a │ b │ c │
├───────┼───────┼────────────────────┤
│ 1 │ 2 │ Η γρήγορη αλεπού │
╞═══════╪═══════╪════════════════════╡
│ 1 │ 2 │ Η γρήγορη αλεπού │
│ │ │ πηδάει πάνω από το │
│ │ │ τεμπέλικο καφέ │
│ │ │ σκυλί │
└───────┴───────┴────────────────────┘
╰───────┴───────┴────────────────────╯
}
do_test 2.32 {
set result "\n[db format -widths {5 5 18} -align {left center center} -wordwrap on \
{SELECT * FROM t1}]"
} {
┌───────┬───────┬────────────────────┐
╭───────┬───────┬────────────────────╮
│ a │ b │ c │
├───────┼───────┼────────────────────┤
│ 1 │ 2 │ Η γρήγορη αλεπού │
╞═══════╪═══════╪════════════════════╡
│ 1 │ 2 │ Η γρήγορη αλεπού │
│ │ │ πηδάει πάνω από το │
│ │ │ τεμπέλικο καφέ │
│ │ │ σκυλί │
└───────┴───────┴────────────────────┘
│ │ │ τεμπέλικο καφέ │
│ │ │ σκυλί │
╰───────┴───────┴────────────────────╯
}
@@ -527,39 +536,39 @@ do_execsql_test 3.0 {
do_test 3.1 {
set result "\n[db format {SELECT * FROM t1}]"
} {
┌───┬───┬────────────────────────┐
╭───┬───┬────────────────────────╮
│ a │ b │ c │
├───┼───┼────────────────────────┤
╞═══╪═══╪════════════════════════╡
│ 1 │ 2 │ abc^[[1;31m123^[[0mxyz │
└───┴───┴────────────────────────┘
╰───┴───┴────────────────────────╯
}
do_test 3.2 {
set result "\n[db format -esc off {SELECT * FROM t1}]"
string map [list \033 X] $result
} {
┌───┬───┬───────────┐
╭───┬───┬───────────╮
│ a │ b │ c │
├───┼───┼───────────┤
╞═══╪═══╪═══════════╡
│ 1 │ 2 │ abcX[1;31m123X[0mxyz │
└───┴───┴───────────┘
╰───┴───┴───────────╯
}
do_test 3.3 {
set result "\n[db format -esc symbol {SELECT * FROM t1}]"
} {
┌───┬───┬──────────────────────┐
╭───┬───┬──────────────────────╮
│ a │ b │ c │
├───┼───┼──────────────────────┤
╞═══╪═══╪══════════════════════╡
│ 1 │ 2 │ abc␛[1;31m123␛[0mxyz │
└───┴───┴──────────────────────┘
╰───┴───┴──────────────────────╯
}
do_test 3.4 {
set result "\n[db format -esc ascii {SELECT * FROM t1}]"
} {
┌───┬───┬────────────────────────┐
╭───┬───┬────────────────────────╮
│ a │ b │ c │
├───┼───┼────────────────────────┤
╞═══╪═══╪════════════════════════╡
│ 1 │ 2 │ abc^[[1;31m123^[[0mxyz │
└───┴───┴────────────────────────┘
╰───┴───┴────────────────────────╯
}
do_test 3.5 {
catch {db format -esc unk {SELECT * FROM t1}} res
@@ -573,31 +582,31 @@ do_execsql_test 4.0 {
do_test 4.1 {
set result "\n[db format -text sql {SELECT * FROM t1}]"
} {
┌─────────────────┬───────────────────────┬────┐
╭─────────────────┬───────────────────────┬────╮
│ a │ b │ c │
├─────────────────┼───────────────────────┼────┤
╞═════════════════╪═══════════════════════╪════╡
│ '{"a":5,"b":6}' │ x'8c1763133117641332' │ 99 │
└─────────────────┴───────────────────────┴────┘
╰─────────────────┴───────────────────────┴────╯
}
do_test 4.2 {
set result "\n[db format -text sql -textjsonb on {SELECT * FROM t1}]"
} {
┌─────────────────┬────────────────────────┬────┐
╭─────────────────┬────────────────────────┬────╮
│ a │ b │ c │
├─────────────────┼────────────────────────┼────┤
╞═════════════════╪════════════════════════╪════╡
│ '{"a":5,"b":6}' │ jsonb('{"c":1,"d":2}') │ 99 │
└─────────────────┴────────────────────────┴────┘
╰─────────────────┴────────────────────────┴────╯
}
do_test 4.3 {
set result "\n[db format -text plain -textjsonb on -wrap 11 \
{SELECT a AS json, b AS jsonb, c AS num FROM t1}]"
} {
┌─────────────┬─────────────┬─────┐
╭─────────────┬─────────────┬─────╮
│ json │ jsonb │ num │
├─────────────┼─────────────┼─────┤
│ {"a":5,"b": │ {"c":1,"d": │ 99 │
╞═════════════╪═════════════╪═════╡
│ {"a":5,"b": │ {"c":1,"d": │ 99 │
│ 6} │ 2} │ │
└─────────────┴─────────────┴─────┘
╰─────────────┴─────────────┴─────╯
}
do_execsql_test 5.0 {
@@ -683,9 +692,9 @@ do_test 5.3a {
-text plain -esc off -textjsonb no \
-wordwrap yes -linelimit 2 $sql]"
} {
┌──────────────┬────────────┬────────────┬────────────────┐
╭──────────────┬────────────┬────────────┬────────────────╮
│ name │ mtime │ time │ value │
├──────────────┼────────────┼────────────┼────────────────┤
╞══════════════╪════════════╪════════════╪════════════════╡
│ sample-jsonb │ 1333101221 │ 2012-03-30 │ x'cc7c57616c70 │
│ │ │ 09:53:41 │ 6861b535332e31 │
│ │ │ │ ... │
@@ -697,7 +706,7 @@ do_test 5.3a {
│ entry-one │ 1708791504 │ 2024-02-24 │ x'000000000000 │
│ │ │ 16:18:24 │ 00000000000000 │
│ │ │ │ ... │
└──────────────┴────────────┴────────────┴────────────────┘
╰──────────────┴────────────┴────────────┴────────────────╯
}
do_test 5.3b {
set result "\n[db format -style table -widths {0 10 10 14}\
@@ -754,14 +763,14 @@ do_test 5.4 {
set result "\n[db format -style box -widths {1 2 3 4 5}\
-linelimit 3 -wordwrap off {SELECT *, 'x' AS x FROM t2}]"
} {
┌────┬────┬─────┬──────┬───────┬───┐
╭────┬────┬─────┬──────┬───────┬───╮
│ a │ b │ c │ d │ e │ x │
├────┼────┼─────┼──────┼───────┼───┤
╞════╪════╪═════╪══════╪═══════╪═══╡
│ ab │ ab │ abc │ abcd │ abcde │ x │
│ cd │ cd │ def │ efgh │ fghij │ │
│ ef │ ef │ ghi │ ijkl │ klmno │ │
│ .. │ .. │ ... │ ... │ ... │ │
└────┴────┴─────┴──────┴───────┴───┘
╰────┴────┴─────┴──────┴───────┴───╯
}
do_execsql_test 6.0 {
@@ -1024,11 +1033,11 @@ do_test 12.1 {
set result "\n[db format -style box -text html \
{SELECT 'abc','','xyz'}]"
} {
┌───────┬────┬───────┐
╭───────┬────┬───────╮
│ 'abc' │ '' │ 'xyz' │
├───────┼────┼───────┤
╞═══════╪════╪═══════╡
│ abc │ │ xyz │
└───────┴────┴───────┘
╰───────┴────┴───────╯
}
db close

View File

@@ -60,30 +60,30 @@ do_test 1.10 {
{SELECT * FROM mlink ORDER BY rowid}]"
} {
┌───────┬───────┬───────┬───────┬──────┬───────┬───────┬───────┐
╭───────┬───────┬───────┬───────┬──────┬───────┬───────┬───────╮
│ mid │ fid │ pmid │ pid │ fnid │ pfnid │ mperm │ isaux │
├───────┼───────┼───────┼───────┼──────┼───────┼───────┼───────┤
╞═══════╪═══════╪═══════╪═══════╪══════╪═══════╪═══════╪═══════╡
│ 28775 │ 28774 │ 28773 │ 28706 │ 1 │ 0 │ 0 │ 0 │
│ 28773 │ 28706 │ 28770 │ 28685 │ 1 │ 0 │ 0 │ 0 │
│ 28770 │ 28736 │ 28769 │ 28695 │ 2 │ 0 │ 0 │ 0 │
│ 28770 │ 28697 │ 28769 │ 28698 │ 3 │ 0 │ 0 │ 0 │
│ 28767 │ 28768 │ 28759 │ 28746 │ 4 │ 0 │ 0 │ 0 │
└───────┴───────┴───────┴───────┴──────┴───────┴───────┴───────┘
╰───────┴───────┴───────┴───────┴──────┴───────┴───────┴───────╯
}
do_test 1.11 {
set x "\n[db format -style box -screenwidth 52 \
{SELECT * FROM mlink ORDER BY rowid}]"
} {
┌─────┬─────┬─────┬─────┬────┬─────┬─────┬─────┐
╭─────┬─────┬─────┬─────┬────┬─────┬─────┬─────╮
│ mid │ fid │pmid │ pid │fnid│pfnid│mperm│isaux│
├─────┼─────┼─────┼─────┼────┼─────┼─────┼─────┤
╞═════╪═════╪═════╪═════╪════╪═════╪═════╪═════╡
│28775│28774│28773│28706│ 1│ 0│ 0│ 0│
│28773│28706│28770│28685│ 1│ 0│ 0│ 0│
│28770│28736│28769│28695│ 2│ 0│ 0│ 0│
│28770│28697│28769│28698│ 3│ 0│ 0│ 0│
│28767│28768│28759│28746│ 4│ 0│ 0│ 0│
└─────┴─────┴─────┴─────┴────┴─────┴─────┴─────┘
╰─────┴─────┴─────┴─────┴────┴─────┴─────┴─────╯
}
do_test 1.20 {

View File

@@ -372,14 +372,14 @@ do_test 1.2 {
ORDER BY name
}]
set exp {
┌──────┬─────┐
╭──────┬─────╮
│ name │ id │
├──────┼─────┤
╞══════╪═════╡
│ 中文 │ 18 │
│ 吴语 │ 173 │
│ 文言 │ 172 │
│ 粵語 │ 75 │
└──────┴─────┘
╰──────┴─────╯
}
if {$res ne $exp} {
puts [list $res]
@@ -395,16 +395,16 @@ do_test 1.3 {
ORDER BY name
}]
set exp {
┌────────┬─────┐
╭────────┬─────╮
│ name │ id │
├────────┼─────┤
╞════════╪═════╡
│ Ido │ 108 │
│ Twi │ 297 │
│ ߒߞߏ │ 258 │
│ ᏣᎳᎩ │ 335 │
│ 日本語 │ 10 │
│ 한국어 │ 37 │
└────────┴─────┘
╰────────┴─────╯
}
if {$res ne $exp} {
puts [list $res]
@@ -420,9 +420,9 @@ do_test 1.4 {
ORDER BY name
}]
set exp {
┌──────┬─────┐
╭──────┬─────╮
│ name │ id │
├──────┼─────┤
╞══════╪═════╡
│ Igbo │ 109 │
│ Jawa │ 115 │
│ Nupe │ 323 │
@@ -440,7 +440,7 @@ do_test 1.4 {
│ ತುಳು │ 311 │
│ ትግርኛ │ 333 │
│ አማርኛ │ 78 │
└──────┴─────┘
╰──────┴─────╯
}
if {$res ne $exp} {
puts [list $res]
@@ -456,9 +456,9 @@ do_test 1.5 {
ORDER BY name
}]
set exp {
┌───────┬─────┐
╭───────┬─────╮
│ name │ id │
├───────┼─────┤
╞═══════╪═════╡
│ Aymar │ 193 │
│ Corsu │ 202 │
│ Dansk │ 31 │
@@ -497,7 +497,7 @@ do_test 1.5 {
│ ಕನ್ನಡ │ 116 │
│ සිංහල │ 158 │
│ ꠍꠤꠟꠐꠤ │ 284 │
└───────┴─────┘
╰───────┴─────╯
}
if {$res ne $exp} {
puts [list $res]
@@ -513,9 +513,9 @@ do_test 1.6 {
ORDER BY name
}]
set exp {
┌────────┬─────┐
╭────────┬─────╮
│ name │ id │
├────────┼─────┤
╞════════╪═════╡
│ Betawi │ 195 │
│ Català │ 28 │
│ Eʋegbe │ 212 │
@@ -564,7 +564,7 @@ do_test 1.6 {
│ മലയാളം │ 130 │
│ རྫོང་ཁ │ 316 │
│ ရခိုင် │ 312 │
└────────┴─────┘
╰────────┴─────╯
}
if {$res ne $exp} {
puts [list $res]

View File

@@ -1304,20 +1304,20 @@ do_test_with_ansi_output shell1-8.2 {
.mode box
SELECT ieee754(47.49) AS x;
}
} {0 {┌───────────────────────────────┐
} {0 {╭───────────────────────────────╮
│ x │
├───────────────────────────────┤
╞═══════════════════════════════╡
│ ieee754(6683623321994527,-47) │
└───────────────────────────────┘}}
╰───────────────────────────────╯}}
do_test_with_ansi_output shell1-8.3 {
catchcmd ":memory: --box" {
select ieee754(6683623321994527,-47) as x;
}
} {0 {┌───────┐
} {0 {╭───────╮
│ x │
├───────┤
╞═══════╡
│ 47.49 │
└───────┘}}
╰───────╯}}
do_test shell1-8.4 {
catchcmd ":memory: --table" {SELECT ieee754_mantissa(47.49) AS M, ieee754_exponent(47.49) AS E;}
} {0 {+------------------+-----+
@@ -1340,15 +1340,15 @@ insert into t values ('too long for one line', 1), ('shorter', NULL);
.width 10 10
.nullvalue NADA
select * from t;}
} {0 {┌────────────┬────────────┐
} {0 {╭────────────┬────────────╮
│ a │ b │
├────────────┼────────────┤
│ too long f │ 1 │
╞════════════╪════════════╡
│ too long f │ 1 │
│ or one lin │ │
│ e │ │
├────────────┼────────────┤
│ shorter │ NADA │
└────────────┴────────────┘}}
╰────────────┴────────────╯}}
#----------------------------------------------------------------------------
# Test cases shell1-9.*: Basic test that "dot" commands and SQL intermix ok.
@@ -1404,24 +1404,24 @@ select base85(zeroblob(2000000000));
# qbox --screenwidth auto --linelimit 5 --charlimit 300 --textjsonb on
#
do_test shell1-12.1 {
catchcmd :memory: {.mode tty
catchcmd :memory: {.mode tty -quote sql
.print
SELECT jsonb(1234) AS x;}
} {0 {
┌───────────────┐
╭───────────────╮
│ x │
├───────────────┤
╞═══════════════╡
│ jsonb('1234') │
└───────────────┘}}
╰───────────────╯}}
do_test shell1-12.2 {
catchcmd :memory: {.mode box --textjsonb on
.print
SELECT jsonb(1234) AS x;}
} {0 {
┌──────┐
╭──────╮
│ x │
├──────┤
╞══════╡
│ 1234 │
└──────┘}}
╰──────╯}}
finish_test

View File

@@ -275,49 +275,49 @@ do_test shell2-1.4.10b {
SELECT * FROM generate_series(0,-2);
SELECT * FROM generate_series(0,2) LIMIT 3;}]]
} {0 {
┌─────────────────────┐
╭─────────────────────╮
│ value │
├─────────────────────┤
╞═════════════════════╡
│ 9223372036854775807 │
└─────────────────────┘
┌─────────────────────┐
╰─────────────────────╯
╭─────────────────────╮
│ value │
├─────────────────────┤
╞═════════════════════╡
│ 9223372036854775807 │
└─────────────────────┘
┌────────────┬──────────────────────┬─────────────────────┐
╰─────────────────────╯
╭────────────┬──────────────────────┬─────────────────────╮
│ avg(value) │ min(value) │ max(value) │
├────────────┼──────────────────────┼─────────────────────┤
│ -0.5 │ -9223372036854775808 │ 9223372036854775807 │
└────────────┴──────────────────────┴─────────────────────┘
┌──────────────────────┐
╞════════════╪══════════════════════╪═════════════════════╡
│ -0.5 │ -9223372036854775808 │ 9223372036854775807 │
╰────────────┴──────────────────────┴─────────────────────╯
╭──────────────────────╮
│ value │
├──────────────────────┤
╞══════════════════════╡
│ -9223372036854775808 │
│ -1 │
│ 9223372036854775806 │
└──────────────────────┘
┌──────────────────────┐
│ -1 │
│ 9223372036854775806 │
╰──────────────────────╯
╭──────────────────────╮
│ value │
├──────────────────────┤
│ 4611686018427387904 │
│ 0 │
╞══════════════════════╡
│ 4611686018427387904 │
│ 0 │
│ -4611686018427387904 │
└──────────────────────┘
┌───────┐
╰──────────────────────╯
╭───────╮
│ value │
├───────┤
│ 0 │
│ -1 │
│ -2 │
└───────┘
┌───────┐
╞═══════╡
│ 0 │
│ -1 │
│ -2 │
╰───────╯
╭───────╮
│ value │
├───────┤
│ 0 │
│ 1 │
│ 2 │
└───────┘}}
╞═══════╡
│ 0 │
│ 1 │
│ 2 │
╰───────╯}}
} ;# ifcapable vtab
ifcapable vtab {

View File

@@ -38,9 +38,9 @@ do_execsql_test shellA-1.0 {
do_test_with_ansi_output shellA-1.2 {
exec {*}$CLI -noinit test.db {.mode box -quote off --escape symbol} {SELECT * FROM t1;}
} {
┌───┬──────────────────────────┐
╭───┬──────────────────────────╮
│ a │ x │
├───┼──────────────────────────┤
╞═══╪══════════════════════════╡
│ 1 │ line with ' single quote │
├───┼──────────────────────────┤
│ 2 │ ␛[31mVT-100 codes␛[0m │
@@ -57,7 +57,7 @@ do_test_with_ansi_output shellA-1.2 {
│ 7 │ carriage␍return │
├───┼──────────────────────────┤
│ 8 │ last line │
└───┴──────────────────────────┘
╰───┴──────────────────────────╯
}
# ".mode list"
@@ -182,9 +182,9 @@ do_test_with_ansi_output shellA-4.1 {
exec {*}$CLI -noinit test.db --box --escape ascii \
{SELECT a, x FROM t1 WHERE a IN (1,2,6,7,8)}
} {
┌───┬──────────────────────────┐
╭───┬──────────────────────────╮
│ a │ x │
├───┼──────────────────────────┤
╞═══╪══════════════════════════╡
│ 1 │ line with ' single quote │
├───┼──────────────────────────┤
│ 2 │ ^[[31mVT-100 codes^[[0m │
@@ -195,7 +195,7 @@ do_test_with_ansi_output shellA-4.1 {
│ 7 │ carriage^Mreturn │
├───┼──────────────────────────┤
│ 8 │ last line │
└───┴──────────────────────────┘
╰───┴──────────────────────────╯
}
do_test_with_ansi_output shellA-4.1b {
exec {*}$CLI -noinit test.db --box --escape ascii \
@@ -203,7 +203,7 @@ do_test_with_ansi_output shellA-4.1b {
{SELECT a, x FROM t1 WHERE a IN (1,2,6,7,8)}
} {
a │ x
───┼──────────────────────────
═══╪══════════════════════════
1 │ line with ' single quote
───┼──────────────────────────
2 │ ^[[31mVT-100 codes^[[0m
@@ -218,22 +218,22 @@ do_test_with_ansi_output shellA-4.1b {
do_test_with_ansi_output shellA-4.2 {
exec {*}$CLI -noinit test.db {.mode qbox} {SELECT a, x FROM t1 WHERE a IN (1,2,6,7,8)}
} {
┌───┬───────────────────────────────────────────┐
╭───┬───────────────────────────────────────────╮
│ a │ x │
├───┼───────────────────────────────────────────┤
╞═══╪═══════════════════════════════════════════╡
│ 1 │ 'line with '' single quote' │
│ 2 │ unistr('\u001b[31mVT-100 codes\u001b[0m') │
│ 6 │ unistr('new\u000aline') │
│ 7 │ unistr('carriage\u000dreturn') │
│ 8 │ 'last line' │
└───┴───────────────────────────────────────────┘
╰───┴───────────────────────────────────────────╯
}
do_test_with_ansi_output shellA-4.2b {
exec {*}$CLI -noinit test.db {.mode qbox -border off} \
{SELECT a, x FROM t1 WHERE a IN (1,2,6,7,8)}
} {
a │ x
───┼───────────────────────────────────────────
═══╪═══════════════════════════════════════════
1 │ 'line with '' single quote'
2 │ unistr('\u001b[31mVT-100 codes\u001b[0m')
6 │ unistr('new\u000aline')