summaryrefslogtreecommitdiff
path: root/test/vt100-a.sql
blob: ecf1b3bfccb1ab497d0b20a63133f87921614d9a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
** Run this script using the "sqlite3" command-line shell
** test test formatting of output text that contains
** vt100 escape sequences.
*/
.open :memory:
.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