Add some torture tests for Unicode support
These are a set of specially-crafted text files designed to exercise most of the corner cases in the Unicode support code, particularly FullUnicodeLine.setChar()'s support for overwriting screen columns with changes in sequence lengths and display widths. For best (worst?) results, use the tests in vttest mode; the lines of exactly 80 columns will be more likely to uncover bugs that way.
This commit is contained in:
parent
c903ed96cd
commit
0da354d0a2
10
tests/controlSequences/combiningCharReplacement.txt
Normal file
10
tests/controlSequences/combiningCharReplacement.txt
Normal file
@ -0,0 +1,10 @@
|
||||
Overwriting a letter with combining diacritic with a letter without in an
|
||||
80-column line:
|
||||
|
||||
xxxxxMu[combining diaeresis]nchenxxx[...] ESC [ 7 G u:
|
||||
xxxxxMünchenxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[7Gu
|
||||
|
||||
Overwriting a letter without combining diacritic with a letter with combining diacritic in an 80-column line:
|
||||
|
||||
xxxxMunchenxxx[...] ESC [ 6 G u [combining diaeresis]:
|
||||
xxxxMunchenxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[6Gü
|
57
tests/wideChars/combining-chars.txt
Normal file
57
tests/wideChars/combining-chars.txt
Normal file
@ -0,0 +1,57 @@
|
||||
East Asian wide characters with combining diacritics:
|
||||
|
||||
中文 [combining low line]:
|
||||
中文̲
|
||||
|
||||
xxx中[combining low line]文:
|
||||
xxx中̲文
|
||||
|
||||
Overwriting an East Asian wide character with combining diacritic with an East
|
||||
Asian wide character without combining diacritic, in the middle of an 80-column
|
||||
line with mixed narrow and wide chars:
|
||||
|
||||
xxx[...]xxx中文[combining low line]xxx[...]xxx你好ESC [ 23 G 国:
|
||||
xxxxxxxxxxxxxxxxxxxx中文̲xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[23G国
|
||||
|
||||
xxx[...]xxx中文[combining low line]。xxx[...]xxx你好xESC [ 23 G 国:
|
||||
xxxxxxxxxxxxxxxxxxxx中文̲。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[23G国
|
||||
|
||||
Overwriting an East Asian wide character with another one with a combining
|
||||
diacritic, in the middle of an 80-column line with mixed narrow and wide chars:
|
||||
|
||||
xxx[...]xxx中文xxx[...]xxx你好ESC [ 23 G 国[combining low line]:
|
||||
xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[23G国̲
|
||||
|
||||
xxx[...]xxx中文。xxx[...]xxx你好xESC [ 23 G 国[combining low line]:
|
||||
xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[23G国̲
|
||||
|
||||
Overwriting a narrow character with an East Asian wide character with a
|
||||
combining diacritic, in the middle of an 80-column line with mixed narrow and
|
||||
wide chars:
|
||||
|
||||
xxx[...]xxx中文xxx[...]xxx你好xESC [ 25 G 。[combining low line]:
|
||||
xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[25G。̲
|
||||
|
||||
xxx[...]xxx中y文xxx[...]xxx你好ESC [ 23 G ,[combining low line]:
|
||||
xxxxxxxxxxxxxxxxxxxx中y文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[23G,̲
|
||||
|
||||
Overwriting a narrow character with a combining diacritic with an East Asian
|
||||
wide character, in the middle of an 80-column line with mixed narrow and
|
||||
widechars:
|
||||
|
||||
xxxxxxxxàxxx[...]xxx中文xxx[...]xxx你好xESC [ 9 G 中:
|
||||
xxxxxxxxàxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[9G中
|
||||
|
||||
xxxxxxxxàxxx[...]xxx中文xxx[...]xxx你好xESC [ 8 G 中:
|
||||
xxxxxxxxàxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[8G中
|
||||
|
||||
Overwriting an East Asian wide character with combining diacritic with a narrow
|
||||
character without combining diacritic, in the middle of an 80-column line with
|
||||
mixed narrow and wide chars:
|
||||
|
||||
xxx[...]xxx中文[combining low line]xxx[...]xxx你好ESC [ 23 G y:
|
||||
xxxxxxxxxxxxxxxxxxxx中文̲xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[23Gy
|
||||
|
||||
xxx[...]xxx中文[combining low line]。xxx[...]xxx你好xESC [ 23 G y:
|
||||
xxxxxxxxxxxxxxxxxxxx中文̲。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[23Gy
|
||||
|
4
tests/wideChars/last-column-wrapping.txt
Normal file
4
tests/wideChars/last-column-wrapping.txt
Normal file
@ -0,0 +1,4 @@
|
||||
A line taking 81 screen columns, with an East Asian wide character at column 79
|
||||
(should be truncated or wrapped on an 80-column terminal):
|
||||
|
||||
xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好
|
6
tests/wideChars/linkification.txt
Normal file
6
tests/wideChars/linkification.txt
Normal file
@ -0,0 +1,6 @@
|
||||
A link on a line with East Asian wide characters:
|
||||
中国国际航空公司 http://www.airchina.com/
|
||||
|
||||
A link on a long line with East Asian wide characters (the link should be
|
||||
wrapped across two lines on an 80-column terminal):
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 中国国际航空公司 http://www.airchina.com/
|
16
tests/wideChars/overwriting1.txt
Normal file
16
tests/wideChars/overwriting1.txt
Normal file
@ -0,0 +1,16 @@
|
||||
Overwriting an East Asian wide character with another one:
|
||||
|
||||
中国 ESC [ 2 D 文:
|
||||
中国[2D文
|
||||
|
||||
xxx中文 ESC [ 2 D 国:
|
||||
xxx中文[2D国
|
||||
|
||||
Overwriting an East Asian wide character with another one, in the middle of
|
||||
an 80-column line with mixed narrow and wide chars:
|
||||
|
||||
xxx[...]xxx中文xxx[...]xxx你好ESC [ 23 G 国:
|
||||
xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[23G国
|
||||
|
||||
xxx[...]xxx中文。xxx[...]xxx你好xESC [ 23 G 国:
|
||||
xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[23G国
|
16
tests/wideChars/overwriting2.txt
Normal file
16
tests/wideChars/overwriting2.txt
Normal file
@ -0,0 +1,16 @@
|
||||
Inserting an East Asian wide character into the middle of another one:
|
||||
|
||||
中国 ESC [ D 文:
|
||||
中国[D文
|
||||
|
||||
xxx中文 ESC [ D 国:
|
||||
xxx中文[D国
|
||||
|
||||
Inserting an East Asian wide character into the middle of another one, in the
|
||||
middle of an 80-column line with mixed narrow and wide chars:
|
||||
|
||||
xxx[...]xxx中文xxx[...]xxx你好xESC [ 24 G 国:
|
||||
xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[24G国
|
||||
|
||||
xxx[...]xxx中文。xxx[...]xxx你好ESC [ 24 G 国:
|
||||
xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[24G国
|
16
tests/wideChars/overwriting3.txt
Normal file
16
tests/wideChars/overwriting3.txt
Normal file
@ -0,0 +1,16 @@
|
||||
Overwriting an East Asian wide character with a narrow character:
|
||||
|
||||
中国 ESC [ 2 D x:
|
||||
中国[2Dx
|
||||
|
||||
xxx中文 ESC [ 2 D x:
|
||||
xxx中文[2Dx
|
||||
|
||||
Overwriting an East Asian wide character with a narrow character, in the middle
|
||||
of an 80-column line with mixed narrow and wide chars:
|
||||
|
||||
xxx[...]xxx中文xxx[...]xxx你好xESC [ 23 G y:
|
||||
xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[23Gy
|
||||
|
||||
xxx[...]xxx中文。xxx[...]xxx你好ESC [ 23 G y:
|
||||
xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[23Gy
|
16
tests/wideChars/overwriting4.txt
Normal file
16
tests/wideChars/overwriting4.txt
Normal file
@ -0,0 +1,16 @@
|
||||
Overwriting a narrow character with an East Asian wide character:
|
||||
|
||||
xxx ESC [ D 中:
|
||||
xxx[D中
|
||||
|
||||
xxx ESC [ 3 D 中:
|
||||
xxx[3D中
|
||||
|
||||
Overwriting a narrow character with an East Asian wide character, in the middle
|
||||
of an 80-column line with mixed narrow and wide chars:
|
||||
|
||||
xxx[...]xxx中文xxx[...]xxx你好xESC [ 25 G 版:
|
||||
xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[25G版
|
||||
|
||||
xxx[...]xxx中文y。xxx[...]xxx你好ESC [ 25 G 版:
|
||||
xxxxxxxxxxxxxxxxxxxx中文y。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[25G版
|
16
tests/wideChars/overwriting5.txt
Normal file
16
tests/wideChars/overwriting5.txt
Normal file
@ -0,0 +1,16 @@
|
||||
Inserting a narrow character into the middle of an East Asian wide character:
|
||||
|
||||
中国 ESC [ D x:
|
||||
中国[Dx
|
||||
|
||||
xxx中文 ESC [ D x:
|
||||
xxx中文[Dx
|
||||
|
||||
Inserting a narrow character into the middle of an East Asian wide character,
|
||||
in the middle of an 80-column line with mixed narrow and wide chars:
|
||||
|
||||
xxx[...]xxx中文xxx[...]xxx你好xESC [ 24 G y:
|
||||
xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[24Gy
|
||||
|
||||
xxx[...]xxx中文。xxx[...]xxx你好ESC [ 24 G y:
|
||||
xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[24Gy
|
100
tests/wideChars/sip-chars.txt
Normal file
100
tests/wideChars/sip-chars.txt
Normal file
@ -0,0 +1,100 @@
|
||||
East Asian wide characters in the Supplementary Ideographic Plane (thanks to
|
||||
http://www.i18nguy.com/unicode/supplementary-test.html):
|
||||
|
||||
𠜎𠜱𠝹𠱓𠱸
|
||||
|
||||
Mixed East Asian wide characters from the BMP and SIP:
|
||||
|
||||
中文:𠜎𠜱,你好,𠝹国。
|
||||
𠱸,中文:你好,𠝹国。
|
||||
|
||||
Narrow characters and mixed east Asian wide characters from the BMP and SIP, in
|
||||
an 80-column line:
|
||||
xxxxxxxxxx中文:𠜎𠜱,你好,xx𠝹国。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好xxxxxxxxxx
|
||||
xxxxxxxxxx𠱸,中文:你xx好,𠝹国。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx好
|
||||
|
||||
Overwriting an East Asian wide character from the SIP with a narrow character:
|
||||
|
||||
中文:𠜎 ESC [ 2 D x:
|
||||
中文:𠜎[2Dx
|
||||
|
||||
xxx中文:𠜎 ESC [ 2 D x:
|
||||
xxx中文:𠜎[2Dx
|
||||
|
||||
Overwriting an East Asian wide character from the SIP with a narrow character,
|
||||
in the middle of an 80-column line with mixed narrow and wide chars:
|
||||
|
||||
xxx[...]xxx中文:𠜎xxx[...]xxx你好xESC [ 27 G y:
|
||||
xxxxxxxxxxxxxxxxxxxx中文:𠜎xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[27Gy
|
||||
|
||||
xxx[...]xxx中文:𠜎。xxx[...]xxx你好ESC [ 27 G y:
|
||||
xxxxxxxxxxxxxxxxxxxx中文:𠜎。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[27Gy
|
||||
|
||||
Overwriting an East Asian wide character from the SIP with an East Asian wide
|
||||
character from the BMP:
|
||||
|
||||
中文:𠜎 ESC [ 2 D 国:
|
||||
中文:𠜎[2D国
|
||||
|
||||
xxx中文:𠜎 ESC [ 2 D 国:
|
||||
xxx中文:𠜎[2D国
|
||||
|
||||
Overwriting an East Asian wide character from the SIP with an East Asian wide
|
||||
character from the BMP in the middle of an 80-column line with mixed narrow and
|
||||
wide chars:
|
||||
|
||||
xxx[...]xxx中文:𠜎xxx[...]xxx你好xESC [ 27 G 国:
|
||||
xxxxxxxxxxxxxxxxxxxx中文:𠜎xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[27G国
|
||||
|
||||
xxx[...]xxx中文:𠜎。xxx[...]xxx你好ESC [ 27 G 国:
|
||||
xxxxxxxxxxxxxxxxxxxx中文:𠜎。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[27G国
|
||||
|
||||
Overwriting an East Asian wide character from the BMP with an East Asian wide
|
||||
character from the SIP:
|
||||
|
||||
中文:国 ESC [ 2 D 𠜎:
|
||||
中文:国[2D𠜎
|
||||
|
||||
xxx中文:国 ESC [ 2 D 𠜎:
|
||||
xxx中文:国[2D𠜎
|
||||
|
||||
Overwriting an East Asian wide character from the BMP with an East Asian wide
|
||||
character from the SIP in the middle of an 80-column line with mixed narrow and
|
||||
wide chars:
|
||||
|
||||
xxx[...]xxx中文:国xxx[...]xxx你好xESC [ 27 G 𠜎:
|
||||
xxxxxxxxxxxxxxxxxxxx中文:国xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[27G𠜎
|
||||
|
||||
xxx[...]xxx中文:国。xxx[...]xxx你好ESC [ 27 G 𠜎:
|
||||
xxxxxxxxxxxxxxxxxxxx中文:国。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[27G𠜎
|
||||
|
||||
Inserting a narrow character into the middle of an East Asian wide character
|
||||
from the SIP in the middle of an 80-column line with mixed narrow and wide
|
||||
chars:
|
||||
|
||||
xxx[...]xxx中文:𠜎xxx[...]xxx你好xESC [ 28 G y:
|
||||
xxxxxxxxxxxxxxxxxxxx中文:𠜎xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[28Gy
|
||||
|
||||
xxx[...]xxx中文:𠜎。xxx[...]xxx你好ESC [ 28 G y:
|
||||
xxxxxxxxxxxxxxxxxxxx中文:𠜎。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[28Gy
|
||||
|
||||
Inserting an East Asian wide character from the SIP into the middle of an East
|
||||
Asian wide character from the BMP in the middle of an 80-column line with mixed
|
||||
narrow and wide chars:
|
||||
|
||||
xxx[...]xxx中文:国xxx[...]xxx你好xESC [ 28 G 𠜎:
|
||||
xxxxxxxxxxxxxxxxxxxx中文:国xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[28G𠜎
|
||||
|
||||
xxx[...]xxx中文:国。xxx[...]xxx你好ESC [ 28 G 𠜎:
|
||||
xxxxxxxxxxxxxxxxxxxx中文:国。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[28G𠜎
|
||||
|
||||
Inserting an East Asian wide character from the BMP into the middle of an East
|
||||
Asian wide character from the SIP in the middle of an 80-column line with mixed
|
||||
narrow and wide chars:
|
||||
|
||||
xxx[...]xxx中文:𠜎xxx[...]xxx你好xESC [ 28 G 国:
|
||||
xxxxxxxxxxxxxxxxxxxx中文:𠜎xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[28G国
|
||||
|
||||
xxx[...]xxx中文:𠜎。xxx[...]xxx你好ESC [ 28 G 国:
|
||||
xxxxxxxxxxxxxxxxxxxx中文:𠜎。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[28G国
|
||||
|
Loading…
Reference in New Issue
Block a user