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:
Steven Luo 2014-05-06 03:55:28 -07:00
parent c903ed96cd
commit 0da354d0a2
10 changed files with 257 additions and 0 deletions

View 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ünchenxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxu
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ü

View 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你好国
xxx[...]xxx中文[combining low line]。xxx[...]xxx你好xESC [ 23 G 国:
xxxxxxxxxxxxxxxxxxxx中文̲。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x国
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你好国̲
xxx[...]xxx中文。xxx[...]xxx你好xESC [ 23 G 国[combining low line]:
xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x国̲
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。̲
xxx[...]xxx中y文xxx[...]xxx你好ESC [ 23 G [combining low line]:
xxxxxxxxxxxxxxxxxxxx中y文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好̲
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中
xxxxxxxxàxxx[...]xxx中文xxx[...]xxx你好xESC [ 8 G 中:
xxxxxxxxàxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x中
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你好y
xxx[...]xxx中文[combining low line]。xxx[...]xxx你好xESC [ 23 G y:
xxxxxxxxxxxxxxxxxxxx中文̲。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好xy

View 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你好

View 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/

View File

@ -0,0 +1,16 @@
Overwriting an East Asian wide character with another one:
中国 ESC [ 2 D 文:
中国文
xxx中文 ESC [ 2 D 国:
xxx中文国
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你好国
xxx[...]xxx中文。xxx[...]xxx你好xESC [ 23 G 国:
xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x国

View File

@ -0,0 +1,16 @@
Inserting an East Asian wide character into the middle of another one:
中国 ESC [ D 文:
中国文
xxx中文 ESC [ D 国:
xxx中文国
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国
xxx[...]xxx中文。xxx[...]xxx你好ESC [ 24 G 国:
xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好国

View File

@ -0,0 +1,16 @@
Overwriting an East Asian wide character with a narrow character:
中国 ESC [ 2 D x:
中国x
xxx中文 ESC [ 2 D x:
xxx中文x
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你好xy
xxx[...]xxx中文。xxx[...]xxx你好ESC [ 23 G y:
xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好y

View File

@ -0,0 +1,16 @@
Overwriting a narrow character with an East Asian wide character:
xxx ESC [ D 中:
xxx中
xxx ESC [ 3 D 中:
xxx中
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版
xxx[...]xxx中文y。xxx[...]xxx你好ESC [ 25 G 版:
xxxxxxxxxxxxxxxxxxxx中文y。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好版

View File

@ -0,0 +1,16 @@
Inserting a narrow character into the middle of an East Asian wide character:
中国 ESC [ D x:
中国x
xxx中文 ESC [ D x:
xxx中文x
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你好xy
xxx[...]xxx中文。xxx[...]xxx你好ESC [ 24 G y:
xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好y

View 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:
中文:𠜎x
xxx中文𠜎 ESC [ 2 D x:
xxx中文𠜎x
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你好xy
xxx[...]xxx中文𠜎。xxx[...]xxx你好ESC [ 27 G y:
xxxxxxxxxxxxxxxxxxxx中文𠜎。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好y
Overwriting an East Asian wide character from the SIP with an East Asian wide
character from the BMP:
中文:𠜎 ESC [ 2 D 国:
中文:𠜎国
xxx中文𠜎 ESC [ 2 D 国:
xxx中文𠜎国
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国
xxx[...]xxx中文𠜎。xxx[...]xxx你好ESC [ 27 G 国:
xxxxxxxxxxxxxxxxxxxx中文𠜎。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好国
Overwriting an East Asian wide character from the BMP with an East Asian wide
character from the SIP:
中文:国 ESC [ 2 D 𠜎:
中文:国𠜎
xxx中文国 ESC [ 2 D 𠜎:
xxx中文𠜎
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𠜎
xxx[...]xxx中文国。xxx[...]xxx你好ESC [ 27 G 𠜎:
xxxxxxxxxxxxxxxxxxxx中文国。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好𠜎
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你好xy
xxx[...]xxx中文𠜎。xxx[...]xxx你好ESC [ 28 G y:
xxxxxxxxxxxxxxxxxxxx中文𠜎。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好y
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𠜎
xxx[...]xxx中文国。xxx[...]xxx你好ESC [ 28 G 𠜎:
xxxxxxxxxxxxxxxxxxxx中文国。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好𠜎
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国
xxx[...]xxx中文𠜎。xxx[...]xxx你好ESC [ 28 G 国:
xxxxxxxxxxxxxxxxxxxx中文𠜎。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好国