Files
sqlite/test/vt100-a.sql
drh 586a649698 Fix the test/vt100-a.sql script to use .testcase and .check.
FossilOrigin-Name: 5cf9e99ff8279530cb73a24794107591f8dab755fe78acd6c11429e532f3d1bf
2025-12-15 13:26:27 +00:00

2.2 KiB

/*
** 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 │
RED │ 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