Add test for generating a colored unicode box which

includes some double-wide characters
This commit is contained in:
Thomas Jensen 2023-05-19 22:08:52 +02:00
parent 6cea61c327
commit 2984cda0ca
No known key found for this signature in database
GPG Key ID: A4ACEE270D0FB7DB
2 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,47 @@
# This config contains UTF-8-encoded elements used correctly, and a simple colored box design.
BOX designA
sample
┏━┳━ 沐宸 若汐 ━┓
┃ ┃ ┋
┃ ┃ ┃
┃ ┃ ┋
┣━╋━━━━━━━━━━━━━┫
┗━┻━━━━━━━━━━━━━┛
ends
# Monochrome sample (with UTF-8):
# ┏━┳━ 沐宸 若汐 ━┓
# ┃ ┃ ┋
# ┃ ┃ ┃
# ┃ ┃ ┋
# ┣━╋━━━━━━━━━━━━━┫
# ┗━┻━━━━━━━━━━━━━┛
shapes {
n (" 沐宸 若汐 ",
" ")
nw ("┏━┳", "┃ ┃")
nnw ("━", " ")
nne ("━", " ")
ne ("┓", "┋")
e ("┃", "┋")
w ("┃ ┃")
se ("┫", "┛")
s ("━", "━")
sw ("┣━╋", "┗━┻")
}
elastic (
nnw, nne, e, w, s
)
padding {
horiz 1
}
replace "ä" with "ö"
reverse "ö" to "ä"
END designA

View File

@ -0,0 +1,17 @@
:ENV
export TERM="xterm-color"
:ARGS
-f 177_utf8_generate_box.cfg -s 21x8 -ac
:INPUT
fäo
:OUTPUT-FILTER
:EXPECTED
┏━┳━━━ 沐宸 若汐 ━━━┓
┃ ┃ ┋
┃ ┃ ┃
┃ ┃ föo ┋
┃ ┃ ┃
┃ ┃ ┋
┣━╋━━━━━━━━━━━━━━━━━┫
┗━┻━━━━━━━━━━━━━━━━━┛
:EOF