586a649698
FossilOrigin-Name: 5cf9e99ff8279530cb73a24794107591f8dab755fe78acd6c11429e532f3d1bf
49 lines
2.2 KiB
SQL
49 lines
2.2 KiB
SQL
/*
|
|
** Run this script using the "sqlite3" command-line shell
|
|
** test test formatting of output text that contains
|
|
** vt100 escape sequences.
|
|
*/
|
|
.mode box -escape off
|
|
CREATE TEMP TABLE t1(a,b,c);
|
|
INSERT INTO t1 VALUES
|
|
('one','twotwotwo','thirty-three'),
|
|
(unistr('\u001b[91mRED\u001b[0m'),'fourfour','fifty-five'),
|
|
('six','seven','eighty-eight');
|
|
.testcase 100
|
|
SELECT * FROM t1;
|
|
.check <<END
|
|
╭─────┬───────────┬──────────────╮
|
|
│ a │ b │ c │
|
|
╞═════╪═══════════╪══════════════╡
|
|
│ one │ twotwotwo │ thirty-three │
|
|
│ [91mRED[0m │ fourfour │ fifty-five │
|
|
│ six │ seven │ eighty-eight │
|
|
╰─────┴───────────┴──────────────╯
|
|
END
|
|
|
|
.mode box -escape ascii
|
|
.testcase 200
|
|
SELECT * FROM t1;
|
|
.check <<END
|
|
╭────────────────┬───────────┬──────────────╮
|
|
│ a │ b │ c │
|
|
╞════════════════╪═══════════╪══════════════╡
|
|
│ one │ twotwotwo │ thirty-three │
|
|
│ ^[[91mRED^[[0m │ fourfour │ fifty-five │
|
|
│ six │ seven │ eighty-eight │
|
|
╰────────────────┴───────────┴──────────────╯
|
|
END
|
|
|
|
.testcase 300
|
|
.mode box -escape symbol
|
|
SELECT * FROM t1;
|
|
.check <<END
|
|
╭──────────────┬───────────┬──────────────╮
|
|
│ a │ b │ c │
|
|
╞══════════════╪═══════════╪══════════════╡
|
|
│ one │ twotwotwo │ thirty-three │
|
|
│ ␛[91mRED␛[0m │ fourfour │ fifty-five │
|
|
│ six │ seven │ eighty-eight │
|
|
╰──────────────┴───────────┴──────────────╯
|
|
END
|