3 ms·
>Sadly, so far as I know, there is no such detailed documentation or test-suite for terminals and terminal emulators. Because they’re fundamentally about visual
by DonHopkins 1y ago
>Sadly, so far as I know, there is no such detailed documentation or test-suite for terminals and terminal emulators. Because they’re fundamentally about visual output, it’s quite difficult to properly test them.
>A special shout-out to vttest which does try to exercise a bunch of corner-cases of VTxxx emulation. Unfortunately, it can only really be used interactively, so it's not useful for automated testing.
https://en.wikipedia.org/wiki/Vttest https://en.wikipedia.org/wiki/Vttest
https://invisible-island.net/vttest/ https://invisible-island.net/vttest/
>Vttest was written in 1983-1985 by Per Lindberg at the Stockholm University Computing Center. The last version was 1.7b (1985-04-19). Per Lindberg later distributed 1.7b via the Usenet mod.sources group (Volume 7, Issue 16, September 2, 1986). It became an established part of the Unix source archives, e.g,. as noted in these postings from 1988.
It even tests for obscure commands like ESC # 8: video alignment test-fill screen with E's
http://www.braun-home.net/michael/info/misc/VT100_commands.htm http://www.braun-home.net/michael/info/misc/VT100_commands.h...
(I know that because I wrote a VT100 emulator in PostScript for NeWS that passed vttest.)
https://donhopkins.com/home/archive/news-tape/utilities/term/term.ps https://donhopkins.com/home/archive/news-tape/utilities/term...
/hash-prefix {
56 eq {
test-pattern
} if
reset-termulator
} def
/do-hash {
/termulate-char //hash-prefix def
} def
/test-pattern {
Columns 0 ne Rows 0 ne and {
Columns string
0 1 Columns 1 sub {
1 index exch 69 put
} for
0 1 Rows 1 sub {
Lines exch get 1 index exch copy pop
} for
pop
} if
slow-refresh
} def
It would detect that it was being tested with vttest by noticing undefined erroneous escape codes, and contemptuously changing the cursor to a hand flashing "the finger" 20 times to anyone who insisted on testing it (Hugh Daniel and Nick Turner at Wedge Computer Inc, all RIP):
/shape-error-cursor { % - => -
gsave
ClientCanvas setcanvas
cursor-can /Mapped false put
newpath
CharWidth CharHeight scale
.2 0 moveto
0 .3 lineto
.1 .5 lineto
.2 .5 lineto
.2 .55 lineto
.3 .6 lineto
.4 .55 lineto
.4 .95 lineto
.5 1 lineto
.6 .95 lineto
.6 .55 lineto
.7 .6 lineto
.8 .55 lineto
.8 .5 lineto
.9 .55 lineto
1 .5 lineto
1 .3 lineto
.8 0 lineto
closepath
cursor-can eoreshapecanvas
cursor-can setcanvas
0 fillcanvas
cursor-state { cursor-on } if
grestore
} def