Debian Codegraph @

test/dblwidth-a.sql

raw
1 #!sqlite3
2 /*
3 ** Run this script using "sqlite3" to confirm that the command-line
4 ** shell properly handles the output of double-width characters.
5 **
6 ** https://sqlite.org/forum/forumpost/008ac80276
7 */
8 .testcase 100
9 .mode box
10 CREATE TABLE data(word TEXT, description TEXT);
11 INSERT INTO data VALUES('〈οὐκέτι〉','Greek without dblwidth <...>');
12 SELECT * FROM data;
13 .check <<END
14 ╭────────────┬──────────────────────────────╮
15 │ word │ description │
16 ╞════════════╪══════════════════════════════╡
17 │ 〈οὐκέτι〉 │ Greek without dblwidth <...> │
18 ╰────────────┴──────────────────────────────╯
19 END
20
21 .testcase 200
22 .mode table
23 SELECT * FROM data;
24 .check <<END
25 +------------+------------------------------+
26 | word | description |
27 +------------+------------------------------+
28 | 〈οὐκέτι〉 | Greek without dblwidth <...> |
29 +------------+------------------------------+
30 END
31
32 .testcase 300
33 .mode qbox
34 SELECT * FROM data;
35 .check <<END
36 ╭──────────────┬────────────────────────────────╮
37 │ word │ description │
38 ╞══════════════╪════════════════════════════════╡
39 │ '〈οὐκέτι〉' │ 'Greek without dblwidth <...>' │
40 ╰──────────────┴────────────────────────────────╯
41 END
42
43 .testcase 400
44 .mode column
45 SELECT * FROM data;
46 .check <<END
47 word description
48 ---------- ----------------------------
49 〈οὐκέτι〉 Greek without dblwidth <...>
50 END