pass. All planned features for ".mode" are implemented, at least at the interface level, though some features are still no-ops. FossilOrigin-Name: e5a81711d0076b447e5bd3206bc04d755a6229b9f4926f42260fcd01ecf3e5a2
65 lines
2.2 KiB
Plaintext
65 lines
2.2 KiB
Plaintext
# 2025-11-12
|
|
#
|
|
# The author disclaims copyright to this source code. In place of
|
|
# a legal notice, here is a blessing:
|
|
#
|
|
# May you do good and not evil.
|
|
# May you find forgiveness for yourself and forgive others.
|
|
# May you share freely, never taking more than you give.
|
|
#
|
|
#***********************************************************************
|
|
#
|
|
# Test cases for the ".mode" command of the CLI.
|
|
# To run these tests:
|
|
#
|
|
# ./sqlite3 <test/modeA.clitest
|
|
#
|
|
#
|
|
CREATE TABLE t1(a,b,c,d,e);
|
|
INSERT INTO t1 VALUES(1,2.5,'three',x'4444',NULL);
|
|
INSERT INTO t1 SELECT b,c,d,e,a FROM t1;
|
|
INSERT INTO t1 SELECT d,e,a,b,c FROM t1;
|
|
.mode box
|
|
|
|
.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:"
|
|
.mode foo
|
|
.output --verify END
|
|
Error: .mode foo
|
|
Error: ^--- unknown mode
|
|
Error: Use ".help .mode" for more info
|
|
END
|
|
|
|
.output memory
|
|
.mode --null xyzzy -v
|
|
.output -glob ' --null "xyzzy"'
|
|
.output memory
|
|
.mode -null abcde -v
|
|
.output -glob ' --null "abcde"'
|