interplane.Get Omega
Read in your language

sqlite

[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.

Brought by drakestapleton

branch master Branches Tags History

sqlite / test / vt100-a.sql

49 lines · 2280 bytes Raw Blame History
1/*
2** Run this script using the "sqlite3" command-line shell
3** test test formatting of output text that contains
4** vt100 escape sequences.
5*/
6.open :memory:
7.mode box -escape off
8CREATE TEMP TABLE t1(a,b,c);
9INSERT INTO t1 VALUES
10 ('one','twotwotwo','thirty-three'),
11 (unistr('\u001b[91mRED\u001b[0m'),'fourfour','fifty-five'),
12 ('six','seven','eighty-eight');
13.testcase 100
14SELECT * FROM t1;
15.check <<END
16╭─────┬───────────┬──────────────╮
17│ a │ b │ c │
18╞═════╪═══════════╪══════════════╡
19│ one │ twotwotwo │ thirty-three │
20│ RED │ fourfour │ fifty-five │
21│ six │ seven │ eighty-eight │
22╰─────┴───────────┴──────────────╯
23END
24
25.mode box -escape ascii
26.testcase 200
27SELECT * FROM t1;
28.check <<END
29╭────────────────┬───────────┬──────────────╮
30│ a │ b │ c │
31╞════════════════╪═══════════╪══════════════╡
32│ one │ twotwotwo │ thirty-three │
33│ ^[[91mRED^[[0m │ fourfour │ fifty-five │
34│ six │ seven │ eighty-eight │
35╰────────────────┴───────────┴──────────────╯
36END
37
38.testcase 300
39.mode box -escape symbol
40SELECT * FROM t1;
41.check <<END
42╭──────────────┬───────────┬──────────────╮
43│ a │ b │ c │
44╞══════════════╪═══════════╪══════════════╡
45│ one │ twotwotwo │ thirty-three │
46│ ␛[91mRED␛[0m │ fourfour │ fifty-five │
47│ six │ seven │ eighty-eight │
48╰──────────────┴───────────┴──────────────╯
49END