sqlite
[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.
Brought by drakestapleton
sqlite / test / dblwidth-a.sql
| 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 | .open :memory: |
| 9 | .mode -reset quote |
| 10 | .testcase 100 |
| 11 | .mode box |
| 12 | CREATE TABLE data(word TEXT, description TEXT); |
| 13 | INSERT INTO data VALUES('〈οὐκέτι〉','Greek without dblwidth <...>'); |
| 14 | SELECT * FROM data; |
| 15 | .check <<END |
| 16 | ╭────────────┬──────────────────────────────╮ |
| 17 | │ word │ description │ |
| 18 | ╞════════════╪══════════════════════════════╡ |
| 19 | │ 〈οὐκέτι〉 │ Greek without dblwidth <...> │ |
| 20 | ╰────────────┴──────────────────────────────╯ |
| 21 | END |
| 22 | |
| 23 | .testcase 200 |
| 24 | .mode table |
| 25 | SELECT * FROM data; |
| 26 | .check <<END |
| 27 | +------------+------------------------------+ |
| 28 | | word | description | |
| 29 | +------------+------------------------------+ |
| 30 | | 〈οὐκέτι〉 | Greek without dblwidth <...> | |
| 31 | +------------+------------------------------+ |
| 32 | END |
| 33 | |
| 34 | .testcase 300 |
| 35 | .mode qbox |
| 36 | SELECT * FROM data; |
| 37 | .check <<END |
| 38 | ╭──────────────┬────────────────────────────────╮ |
| 39 | │ word │ description │ |
| 40 | ╞══════════════╪════════════════════════════════╡ |
| 41 | │ '〈οὐκέτι〉' │ 'Greek without dblwidth <...>' │ |
| 42 | ╰──────────────┴────────────────────────────────╯ |
| 43 | END |
| 44 | |
| 45 | .testcase 400 |
| 46 | .mode column |
| 47 | SELECT * FROM data; |
| 48 | .check <<END |
| 49 | word description |
| 50 | ---------- ---------------------------- |
| 51 | 〈οὐκέτι〉 Greek without dblwidth <...> |
| 52 | END |