forked from emacsattic/nterm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnterm-ut.el
More file actions
executable file
·943 lines (893 loc) · 30.5 KB
/
nterm-ut.el
File metadata and controls
executable file
·943 lines (893 loc) · 30.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
;; -*-coding: utf-8 -*-
;;; nterm-ut.el --- nterm unit testing
;;; Commentary:
;;; THANKS:
;;; BUGS:
;;; INSTALLATION:
;;; Code:
(require 'ert-ui)
(require 'nterm)
(defun nterm-ut-checksum ()
"Display screen and memory checksum.
It places the result in the kill ring."
(interactive)
(let ((string (format "\"%s\" \"%s\""
(md5 (get-buffer nterm-buffer-name))
(nterm-mem-checksum))))
(kill-new string)
(message string)))
(defun nterm-ut-init ()
"Init nterm for unit testing"
(if (get-buffer nterm-buffer-name)
(kill-buffer nterm-buffer-name))
(setq nterm-unit-testing t)
(nterm-mode))
(defun nterm-ut (md5-buf md5-mem record)
"Emulate sequence RECORD then checksum screen and memory."
(nterm-ut-init)
(nterm-emulate nil record)
(setq nterm-unit-testing nil)
(and
(string= (md5 (get-buffer nterm-buffer-name)) md5-buf)
(string= (nterm-mem-checksum) md5-mem)))
;;; Test of cursor movements
(ert-deftest nterm-vttest-1-1 ()
(should (nterm-ut
"8752c42bb037e167ca4d0b5c1eaa3806" "2601cc448dbfd675b3a32619b3791995"
(concat
"[2J[?3l#8[9;10H[1J"
"[18;60H[0J[1K[9;71H[0K[10;10H[1K[10;71H[0K[11;10H"
"[1K[11;71H[0K[12;10H[1K[12;71H[0K[13;10H[1K[13;71H"
"[0K[14;10H[1K[14;71H[0K[15;10H[1K[15;71H[0K[16;10H"
"[1K[16;71H[0K[17;30H[2K[24;1f*[1;1f*[24;2f*[1;2f*[2"
"4;3f*[1;3f*[24;4f*[1;4f*[24;5f*[1;5f*[24;6f*[1;6f*[2"
"4;7f*[1;7f*[24;8f*[1;8f*[24;9f*[1;9f*[24;10f*[1;10f*"
"[24;11f*[1;11f*[24;12f*[1;12f*[24;13f*[1;13f*[24;14f*"
"[1;14f*[24;15f*[1;15f*[24;16f*[1;16f*[24;17f*[1;17f*["
"24;18f*[1;18f*[24;19f*[1;19f*[24;20f*[1;20f*[24;21f*["
"1;21f*[24;22f*[1;22f*[24;23f*[1;23f*[24;24f*[1;24f*[2"
"4;25f*[1;25f*[24;26f*[1;26f*[24;27f*[1;27f*[24;28f*[1"
";28f*[24;29f*[1;29f*[24;30f*[1;30f*[24;31f*[1;31f*[24"
";32f*[1;32f*[24;33f*[1;33f*[24;34f*[1;34f*[24;35f*[1;"
"35f*[24;36f*[1;36f*[24;37f*[1;37f*[24;38f*[1;38f*[24;"
"39f*[1;39f*[24;40f*[1;40f*[24;41f*[1;41f*[24;42f*[1;4"
"2f*[24;43f*[1;43f*[24;44f*[1;44f*[24;45f*[1;45f*[24;4"
"6f*[1;46f*[24;47f*[1;47f*[24;48f*[1;48f*[24;49f*[1;49"
"f*[24;50f*[1;50f*[24;51f*[1;51f*[24;52f*[1;52f*[24;53"
"f*[1;53f*[24;54f*[1;54f*[24;55f*[1;55f*[24;56f*[1;56f"
"*[24;57f*[1;57f*[24;58f*[1;58f*[24;59f*[1;59f*[24;60f"
"*[1;60f*[24;61f*[1;61f*[24;62f*[1;62f*[24;63f*[1;63f*"
"[24;64f*[1;64f*[24;65f*[1;65f*[24;66f*[1;66f*[24;67f*"
"[1;67f*[24;68f*[1;68f*[24;69f*[1;69f*[24;70f*[1;70f*"
"[24;71f*[1;71f*[24;72f*[1;72f*[24;73f*[1;73f*[24;74f*"
"[1;74f*[24;75f*[1;75f*[24;76f*[1;76f*[24;77f*[1;77f*["
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1D[1C[0D+[1D[1C[0D+[1D[1C[0"
"D+[1D[1C[0D+[1D[1C[0D+[1D[1C[0D+[1D[1C[0D+"
"[1D[1C[0D+[1D[1C[0D+[1D[1C[0D+[1D[1C[0D+[1D"
"[1C[0D[1;1H[10A[1A[0A[24;80H[10B[1B[0B[10;12H "
" [1B["
"58D "
" [1B[58D "
" [1B[58D "
" [1B[58D "
" [1B[58D "
" [1B[58D[5A[1CThe screen sho"
"uld be cleared, and have an unbroken bor-[12;13Hder of *'s"
" and +'s around the edge, and exactly in the[13;13Hmiddle"
" there should be a frame of E's around this text[14;13Hwi"
"th one (1) free position around it. Push <RETURN>"))))
(ert-deftest nterm-vttest-1-3 ()
(should (nterm-ut
"3e98ebe35b09b63d405b209dbc53c8d4" "1ab768a2b495fa6e0afac3fb8457fc59"
(concat
"[?7h[?3l[?"
"3lTest of autowrap, mixing control and print characters.T"
"he left/right margins should have letters in order:[3;21"
"r[?6h[19;1HA[19;80Ha[18;80HaB[19;80HB b[19;80HC"
" c[19;2HC[19;80H[18;1HD[18;80Hd[19;1HE[19;80He"
"[18;80HeF[19;80HF f[19;80HG g[19;2HG[19;80H"
"[18;1HH[18;80Hh[19;1HI[19;80Hi[18;80HiJ[19;80HJ j"
"[19;80HK k[19;2HK[19;80H[18;1HL[18;80Hl[19;1HM"
"[19;80Hm[18;80HmN[19;80HN n[19;80HO o[19;2HO"
"[19;80H[18;1HP[18;80Hp[19;1HQ[19;80Hq[18;80HqR[19;"
"80HR r[19;80HS s[19;2HS[19;80H[18;1HT[18;80H"
"t[19;1HU[19;80Hu[18;80HuV[19;80HV v[19;80HW w["
"19;2HW[19;80H[18;1HX[18;80Hx[19;1HY[19;80Hy[18;"
"80HyZ[19;80HZ z[?6l[r[22;1HPush <RETURN>"))))
(ert-deftest nterm-vttest-1-5 ()
(should (nterm-ut
"ef9d62ea5e6fda8be254102039b3255a" "a80541da236f0833e9c3ef725af7200d"
(concat
"[?"
"3l[2J[1;1HTest of cursor-control characters inside ESC seq"
"uences.Below should be four identical lines:A B C D"
" E F G H IA[2CB[2CC[2CD[2CE[2CF[2CG[2CH[2"
"CI[2CA [2CB[4CC[6CD[8CE[10CF[12CG[14CH["
"16CI[20lA [1AB [1AC [1AD [1AE [1AF [1AG [1"
"AH [1AI [1APush <RETURN>"))))
(ert-deftest nterm-vttest-1-6 ()
(should (nterm-ut
"896bbb6c0159f94a75a1415ab62dedda" "ebe079c1fd8b81b5d61ea9188d17dc26"
(concat
"[2J[1;1HTest of leading "
"zeros in ESC sequences.Two lines below you should see the"
" sentence \"This is a correct sentence\".[00000000004;0000000"
"01HT[00000000004;000000002Hh[00000000004;000000003Hi[0000"
"0000004;000000004Hs[00000000004;000000005H [00000000004;00"
"0000006Hi[00000000004;000000007Hs[00000000004;000000008H "
"[00000000004;000000009Ha[00000000004;0000000010H [00000000"
"004;0000000011Hc[00000000004;0000000012Ho[00000000004;0000"
"000013Hr[00000000004;0000000014Hr[00000000004;0000000015He"
"[00000000004;0000000016Hc[00000000004;0000000017Ht[000000"
"00004;0000000018H [00000000004;0000000019Hs[00000000004;00"
"00000020He[00000000004;0000000021Hn[00000000004;0000000022"
"Ht[00000000004;0000000023He[00000000004;0000000024Hn[0000"
"0000004;0000000025Hc[00000000004;0000000026He[20;1HPush <R"
"ETURN>"))))
;;; Test of screen features
(ert-deftest nterm-vttest-2-1 ()
(should (nterm-ut
"ad8d360cca3dd644390124a846e397cd" "33c2707fe415cd6bd36fbe99279982cb"
(concat
"[2J[1;1H[?7h*******************************************"
"************************************************************"
"*********************************************************[?"
"7l[3;1H****************************************************"
"************************************************************"
"************************************************[?7h[5;1HT"
"his should be three identical lines of *'s completely fillin"
"gthe top of the screen without any empty lines between."
"(Test of WRAP AROUND mode setting.)Push <RETURN>"))))
(ert-deftest nterm-vttest-2-2 ()
(should (nterm-ut
"ec57a300b5c796408c7ae6d51ae2146a" "689c6d2d0443f7e27bf7f0d6ffacb1db"
(concat
"[2J[3g"
"[1;1H[3CH[3CH[3CH[3CH[3CH[3CH[3CH[3CH[3CH"
"[3CH[3CH[3CH[3CH[3CH[3CH[3CH[3CH[3CH[3CH"
"[3CH[3CH[3CH[3CH[3CH[3CH[3CH[1;4H[0g[6C[0g"
"[6C[0g[6C[0g[6C[0g[6C[0g[6C[0g[6C[0g[6C[0g[6C"
"[0g[6C[0g[6C[0g[6C[0g[6C[1;7H[1g[2g[1;1H * * * *"
" * * * * * * * * *[2;2H * * * * * *"
" * * * * * * *[4;1HTest of TAB "
"setting/resetting. These two linesshould look the same. P"
"ush <RETURN>"))))
(ert-deftest nterm-vttest-2-3 ()
(should (nterm-ut
"0bd1cae765007548eae21bd37f206a02" "13255ee965350900167b32473909fe99"
(concat
"[?5h[?3h[2J[1;1H[3g[8CH[8CH[8CH[8CH"
"[8CH[8CH[8CH[8CH[8CH[8CH[8CH[8CH[8CH[8CH"
"[8CH[8CH[8CH[1;1H123456789012345678901234567890123456"
"789012345678901234567890123456789012345678901234567890123456"
"78901234567890123456789012345678901[3;3HThis is 132 column "
"mode, light background.[4;4HThis is 132 column mode, light "
"background.[5;5HThis is 132 column mode, light background."
"[6;6HThis is 132 column mode, light background.[7;7HThis is"
" 132 column mode, light background.[8;8HThis is 132 column "
"mode, light background.[9;9HThis is 132 column mode, light "
"background.[10;10HThis is 132 column mode, light background"
".[11;11HThis is 132 column mode, light background.[12;12HT"
"his is 132 column mode, light background.[13;13HThis is 132"
" column mode, light background.[14;14HThis is 132 column mo"
"de, light background.[15;15HThis is 132 column mode, light "
"background.[16;16HThis is 132 column mode, light background"
".[17;17HThis is 132 column mode, light background.[18;18HT"
"his is 132 column mode, light background.[19;19HThis is 132"
" column mode, light background.[20;20HThis is 132 column mo"
"de, light background.Push <RETURN>"))))
(ert-deftest nterm-vttest-2-7 ()
(should (nterm-ut
"f70ca90ba5a60c526d2c66c0d9eac1c7" "d6f0b5ffd36573c384280a7e2ae7a63d"
(concat
"[2J[?6h[?4h[12;13r[2J[24BSoft "
"scroll up region [12..13] size 2 Line 1Soft scroll up regi"
"on [12..13] size 2 Line 2Soft scroll up region [12..13] si"
"ze 2 Line 3Soft scroll up region [12..13] size 2 Line 4S"
"oft scroll up region [12..13] size 2 Line 5Soft scroll up "
"region [12..13] size 2 Line 6Soft scroll up region [12..13"
"] size 2 Line 7Soft scroll up region [12..13] size 2 Line "
"8Soft scroll up region [12..13] size 2 Line 9Soft scroll"
" up region [12..13] size 2 Line 10Soft scroll up region [1"
"2..13] size 2 Line 11Soft scroll up region [12..13] size 2"
" Line 12Soft scroll up region [12..13] size 2 Line 13Sof"
"t scroll up region [12..13] size 2 Line 14Soft scroll up r"
"egion [12..13] size 2 Line 15Soft scroll up region [12..13"
"] size 2 Line 16Soft scroll up region [12..13] size 2 Line"
" 17Soft scroll up region [12..13] size 2 Line 18Soft scr"
"oll up region [12..13] size 2 Line 19Soft scroll up region"
" [12..13] size 2 Line 20Soft scroll up region [12..13] siz"
"e 2 Line 21Soft scroll up region [12..13] size 2 Line 22"
"Soft scroll up region [12..13] size 2 Line 23Soft scroll u"
"p region [12..13] size 2 Line 24Soft scroll up region [12."
".13] size 2 Line 25Soft scroll up region [12..13] size 2 L"
"ine 26Soft scroll up region [12..13] size 2 Line 27Soft "
"scroll up region [12..13] size 2 Line 28Soft scroll up reg"
"ion [12..13] size 2 Line 29[24ASoft scroll down region [1"
"2..13] size 2 Line 1MMSoft scroll down region [12..13] s"
"ize 2 Line 2MMSoft scroll down region [12..13] size 2 Li"
"ne 3MMSoft scroll down region [12..13] size 2 Line 4M"
"MSoft scroll down region [12..13] size 2 Line 5MMSoft s"
"croll down region [12..13] size 2 Line 6MMSoft scroll do"
"wn region [12..13] size 2 Line 7MMSoft scroll down regio"
"n [12..13] size 2 Line 8MMSoft scroll down region [12..1"
"3] size 2 Line 9MMSoft scroll down region [12..13] size "
"2 Line 10MMSoft scroll down region [12..13] size 2 Line "
"11MMSoft scroll down region [12..13] size 2 Line 12M"
"MSoft scroll down region [12..13] size 2 Line 13MMSoft s"
"croll down region [12..13] size 2 Line 14MMSoft scroll d"
"own region [12..13] size 2 Line 15MMSoft scroll down reg"
"ion [12..13] size 2 Line 16MMSoft scroll down region [12"
"..13] size 2 Line 17MMSoft scroll down region [12..13] s"
"ize 2 Line 18MMSoft scroll down region [12..13] size 2 L"
"ine 19MMSoft scroll down region [12..13] size 2 Line 20"
"MMSoft scroll down region [12..13] size 2 Line 21MMSo"
"ft scroll down region [12..13] size 2 Line 22MMSoft scro"
"ll down region [12..13] size 2 Line 23MMSoft scroll down"
" region [12..13] size 2 Line 24MMSoft scroll down region"
" [12..13] size 2 Line 25MMSoft scroll down region [12..1"
"3] size 2 Line 26MMSoft scroll down region [12..13] size"
" 2 Line 27MMSoft scroll down region [12..13] size 2 Line"
" 28MMSoft scroll down region [12..13] size 2 Line 29M"
"MPush <RETURN>"))))
(ert-deftest nterm-vttest-2-8 ()
(should (nterm-ut
"57237d69771a6593eb105eb152bb0549" "fecd5cbe33f4903d12007abe3f80e063"
(concat
"[1;24r[2J[24BSoft scroll up region [1..24] size 24 Line"
" 1Soft scroll up region [1..24] size 24 Line 2Soft scrol"
"l up region [1..24] size 24 Line 3Soft scroll up region [1"
"..24] size 24 Line 4Soft scroll up region [1..24] size 24 "
"Line 5Soft scroll up region [1..24] size 24 Line 6Soft s"
"croll up region [1..24] size 24 Line 7Soft scroll up regio"
"n [1..24] size 24 Line 8Soft scroll up region [1..24] size"
" 24 Line 9Soft scroll up region [1..24] size 24 Line 10S"
"oft scroll up region [1..24] size 24 Line 11Soft scroll up"
" region [1..24] size 24 Line 12Soft scroll up region [1..2"
"4] size 24 Line 13Soft scroll up region [1..24] size 24 Li"
"ne 14Soft scroll up region [1..24] size 24 Line 15Soft s"
"croll up region [1..24] size 24 Line 16Soft scroll up regi"
"on [1..24] size 24 Line 17Soft scroll up region [1..24] si"
"ze 24 Line 18Soft scroll up region [1..24] size 24 Line 19"
"Soft scroll up region [1..24] size 24 Line 20Soft scroll"
" up region [1..24] size 24 Line 21Soft scroll up region [1"
"..24] size 24 Line 22Soft scroll up region [1..24] size 24"
" Line 23Soft scroll up region [1..24] size 24 Line 24Sof"
"t scroll up region [1..24] size 24 Line 25Soft scroll up r"
"egion [1..24] size 24 Line 26Soft scroll up region [1..24]"
" size 24 Line 27Soft scroll up region [1..24] size 24 Line"
" 28Soft scroll up region [1..24] size 24 Line 29[24ASof"
"t scroll down region [1..24] size 24 Line 1MMSoft scroll"
" down region [1..24] size 24 Line 2MMSoft scroll down re"
"gion [1..24] size 24 Line 3MMSoft scroll down region [1."
".24] size 24 Line 4MMSoft scroll down region [1..24] siz"
"e 24 Line 5MMSoft scroll down region [1..24] size 24 Lin"
"e 6MMSoft scroll down region [1..24] size 24 Line 7M"
"MSoft scroll down region [1..24] size 24 Line 8MMSoft sc"
"roll down region [1..24] size 24 Line 9MMSoft scroll dow"
"n region [1..24] size 24 Line 10MMSoft scroll down regio"
"n [1..24] size 24 Line 11MMSoft scroll down region [1..2"
"4] size 24 Line 12MMSoft scroll down region [1..24] size"
" 24 Line 13MMSoft scroll down region [1..24] size 24 Lin"
"e 14MMSoft scroll down region [1..24] size 24 Line 15"
"MMSoft scroll down region [1..24] size 24 Line 16MMSoft"
" scroll down region [1..24] size 24 Line 17MMSoft scroll"
" down region [1..24] size 24 Line 18MMSoft scroll down r"
"egion [1..24] size 24 Line 19MMSoft scroll down region ["
"1..24] size 24 Line 20MMSoft scroll down region [1..24] "
"size 24 Line 21MMSoft scroll down region [1..24] size 24"
" Line 22MMSoft scroll down region [1..24] size 24 Line 2"
"3MMSoft scroll down region [1..24] size 24 Line 24MM"
"Soft scroll down region [1..24] size 24 Line 25MMSoft sc"
"roll down region [1..24] size 24 Line 26MMSoft scroll do"
"wn region [1..24] size 24 Line 27MMSoft scroll down regi"
"on [1..24] size 24 Line 28MMSoft scroll down region [1.."
"24] size 24 Line 29MMPush <RETURN>"))))
(ert-deftest nterm-vttest-2-9 ()
(should (nterm-ut
"ce90d4034120133556b3570be638ebd8" "db7c7631cc5ccfdcd51deb3ac0243dda"
(concat
"[?4l[12;13r[2J[24B"
"Jump scroll up region [12..13] size 2 Line 1Jump scroll up"
" region [12..13] size 2 Line 2Jump scroll up region [12..1"
"3] size 2 Line 3Jump scroll up region [12..13] size 2 Line"
" 4Jump scroll up region [12..13] size 2 Line 5Jump scrol"
"l up region [12..13] size 2 Line 6Jump scroll up region [1"
"2..13] size 2 Line 7Jump scroll up region [12..13] size 2 "
"Line 8Jump scroll up region [12..13] size 2 Line 9Jump s"
"croll up region [12..13] size 2 Line 10Jump scroll up regi"
"on [12..13] size 2 Line 11Jump scroll up region [12..13] s"
"ize 2 Line 12Jump scroll up region [12..13] size 2 Line 13"
"Jump scroll up region [12..13] size 2 Line 14Jump scroll"
" up region [12..13] size 2 Line 15Jump scroll up region [1"
"2..13] size 2 Line 16Jump scroll up region [12..13] size 2"
" Line 17Jump scroll up region [12..13] size 2 Line 18Jum"
"p scroll up region [12..13] size 2 Line 19Jump scroll up r"
"egion [12..13] size 2 Line 20Jump scroll up region [12..13"
"] size 2 Line 21Jump scroll up region [12..13] size 2 Line"
" 22Jump scroll up region [12..13] size 2 Line 23Jump scr"
"oll up region [12..13] size 2 Line 24Jump scroll up region"
" [12..13] size 2 Line 25Jump scroll up region [12..13] siz"
"e 2 Line 26Jump scroll up region [12..13] size 2 Line 27"
"Jump scroll up region [12..13] size 2 Line 28Jump scroll u"
"p region [12..13] size 2 Line 29[24AJump scroll down regi"
"on [12..13] size 2 Line 1MMJump scroll down region [12.."
"13] size 2 Line 2MMJump scroll down region [12..13] size"
" 2 Line 3MMJump scroll down region [12..13] size 2 Line "
"4MMJump scroll down region [12..13] size 2 Line 5MMJ"
"ump scroll down region [12..13] size 2 Line 6MMJump scro"
"ll down region [12..13] size 2 Line 7MMJump scroll down "
"region [12..13] size 2 Line 8MMJump scroll down region ["
"12..13] size 2 Line 9MMJump scroll down region [12..13] "
"size 2 Line 10MMJump scroll down region [12..13] size 2 "
"Line 11MMJump scroll down region [12..13] size 2 Line 12"
"MMJump scroll down region [12..13] size 2 Line 13MMJ"
"ump scroll down region [12..13] size 2 Line 14MMJump scr"
"oll down region [12..13] size 2 Line 15MMJump scroll dow"
"n region [12..13] size 2 Line 16MMJump scroll down regio"
"n [12..13] size 2 Line 17MMJump scroll down region [12.."
"13] size 2 Line 18MMJump scroll down region [12..13] siz"
"e 2 Line 19MMJump scroll down region [12..13] size 2 Lin"
"e 20MMJump scroll down region [12..13] size 2 Line 21"
"MMJump scroll down region [12..13] size 2 Line 22MMJump"
" scroll down region [12..13] size 2 Line 23MMJump scroll"
" down region [12..13] size 2 Line 24MMJump scroll down r"
"egion [12..13] size 2 Line 25MMJump scroll down region ["
"12..13] size 2 Line 26MMJump scroll down region [12..13]"
" size 2 Line 27MMJump scroll down region [12..13] size 2"
" Line 28MMJump scroll down region [12..13] size 2 Line 2"
"9MMPush <RETURN>"))))
(ert-deftest nterm-vttest-2-8 ()
(should (nterm-ut
"f6c6e5734a13c0d8a8443188d1467c7c" "2c7729fcec5c92cb915ba7456e41ed1e"
(concat
"[1;24r[2J[24BJump scroll up region [1"
"..24] size 24 Line 1Jump scroll up region [1..24] size 24 "
"Line 2Jump scroll up region [1..24] size 24 Line 3Jump s"
"croll up region [1..24] size 24 Line 4Jump scroll up regio"
"n [1..24] size 24 Line 5Jump scroll up region [1..24] size"
" 24 Line 6Jump scroll up region [1..24] size 24 Line 7Ju"
"mp scroll up region [1..24] size 24 Line 8Jump scroll up r"
"egion [1..24] size 24 Line 9Jump scroll up region [1..24] "
"size 24 Line 10Jump scroll up region [1..24] size 24 Line "
"11Jump scroll up region [1..24] size 24 Line 12Jump scro"
"ll up region [1..24] size 24 Line 13Jump scroll up region "
"[1..24] size 24 Line 14Jump scroll up region [1..24] size "
"24 Line 15Jump scroll up region [1..24] size 24 Line 16J"
"ump scroll up region [1..24] size 24 Line 17Jump scroll up"
" region [1..24] size 24 Line 18Jump scroll up region [1..2"
"4] size 24 Line 19Jump scroll up region [1..24] size 24 Li"
"ne 20Jump scroll up region [1..24] size 24 Line 21Jump s"
"croll up region [1..24] size 24 Line 22Jump scroll up regi"
"on [1..24] size 24 Line 23Jump scroll up region [1..24] si"
"ze 24 Line 24Jump scroll up region [1..24] size 24 Line 25"
"Jump scroll up region [1..24] size 24 Line 26Jump scroll"
" up region [1..24] size 24 Line 27Jump scroll up region [1"
"..24] size 24 Line 28Jump scroll up region [1..24] size 24"
" Line 29[24AJump scroll down region [1..24] size 24 Line "
"1MMJump scroll down region [1..24] size 24 Line 2MMJ"
"ump scroll down region [1..24] size 24 Line 3MMJump scro"
"ll down region [1..24] size 24 Line 4MMJump scroll down "
"region [1..24] size 24 Line 5MMJump scroll down region ["
"1..24] size 24 Line 6MMJump scroll down region [1..24] s"
"ize 24 Line 7MMJump scroll down region [1..24] size 24 L"
"ine 8MMJump scroll down region [1..24] size 24 Line 9"
"MMJump scroll down region [1..24] size 24 Line 10MMJump"
" scroll down region [1..24] size 24 Line 11MMJump scroll"
" down region [1..24] size 24 Line 12MMJump scroll down r"
"egion [1..24] size 24 Line 13MMJump scroll down region ["
"1..24] size 24 Line 14MMJump scroll down region [1..24] "
"size 24 Line 15MMJump scroll down region [1..24] size 24"
" Line 16MMJump scroll down region [1..24] size 24 Line 1"
"7MMJump scroll down region [1..24] size 24 Line 18MM"
"Jump scroll down region [1..24] size 24 Line 19MMJump sc"
"roll down region [1..24] size 24 Line 20MMJump scroll do"
"wn region [1..24] size 24 Line 21MMJump scroll down regi"
"on [1..24] size 24 Line 22MMJump scroll down region [1.."
"24] size 24 Line 23MMJump scroll down region [1..24] siz"
"e 24 Line 24MMJump scroll down region [1..24] size 24 Li"
"ne 25MMJump scroll down region [1..24] size 24 Line 26"
"MMJump scroll down region [1..24] size 24 Line 27MMJum"
"p scroll down region [1..24] size 24 Line 28MMJump scrol"
"l down region [1..24] size 24 Line 29MMPush <RETURN>"))))
(ert-deftest nterm-vttest-2-9 ()
(should (nterm-ut
"be9e1cda05e462b8741b1e170421d8eb" "4e73d78f3c4e0914862fcbb1f14d3bb8"
(concat
"[?6h[2J"
"[23;24rOrigin mode test. This line should be at the botto"
"m of the screen.[1;1HThis line should be the one above the "
"bottom of the screen. Push <RETURN>"))))
(ert-deftest nterm-vttest-2-11 ()
(should (nterm-ut
"717f7f37fdc1b05bdb2d89c1ff402bd6" "b82f146cded7b046ed104d3f79191d80"
(concat
"[2J[?6l[24;1HOrigin mo"
"de test. This line should be at the bottom of the screen.[1"
";1HThis line should be at the top of the screen. Push <RETUR"
"N>"))))
(ert-deftest nterm-vttest-2-12 ()
(should (nterm-ut
"417ec59bc343d9e5c81cc0b78b559290" "2f79b4f07884791de4d68411bb7b88c8"
(concat
"[1;24r[2J[1;20HGraphic rendition test pattern:[4;1H[0"
"mvanilla[4;40H[0;1mbold[6;6H[;4munderline[6;45H[;1m[4"
"mbold underline[8;1H[0;5mblink[8;40H[0;5;1mbold blink[1"
"0;6H[0;4;5munderline blink[10;45H[0;1;4;5mbold underline "
"blink[12;1H[1;4;5;0;7mnegative[12;40H[0;1;7mbold negativ"
"e[14;6H[0;4;7munderline negative[14;45H[0;1;4;7mbold und"
"erline negative[16;1H[1;4;;5;7mblink negative[16;40H[0;1"
";5;7mbold blink negative[18;6H[0;4;5;7munderline blink neg"
"ative[18;45H[0;1;4;5;7mbold underline blink negative[m[?"
"5l[23;1H[0KDark background. Push <RETURN>"))))
(ert-deftest nterm-vttest-2-14 ()
(should (nterm-ut
"8c26f608afa218d6d30c77e11625727b" "2f37168f73de511effd3f6d40b7b0e63"
(concat
"[?5l[2J[8;12Hnormal[8;24Hb"
"old[8;36Hunderscored[8;48Hblinking[8;60Hreversed[10;1Hst"
"ars:[12;1Hline:[14;1Hx'es:[16;1Hdiamonds:[10;12H[;0m(B"
")B*****7[1;1H[m(B)BA8*****[10;24H[;1m(B)B*****"
"7[1;2H[m(B)BA8*****[10;36H[;4m(B)B*****7[1;3H"
"[m(B)BA8*****[10;48H[;5m(B)B*****7[1;4H[m(B)B"
"A8*****[10;60H[;7m(B)B*****7[1;5H[m(B)BA8*****"
"[12;12H[;0m(0)Bqqqqq7[2;1H[m(B)BA8qqqqq[12;24H["
";1m(0)Bqqqqq7[2;2H[m(B)BA8qqqqq[12;36H[;4m(0)B"
"qqqqq7[2;3H[m(B)BA8qqqqq[12;48H[;5m(0)Bqqqqq7"
"[2;4H[m(B)BA8qqqqq[12;60H[;7m(0)Bqqqqq7[2;5H[m"
"(B)BA8qqqqq[14;12H[;0m(B)Bxxxxx7[3;1H[m(B)BA8"
"xxxxx[14;24H[;1m(B)Bxxxxx7[3;2H[m(B)BA8xxxxx[14"
";36H[;4m(B)Bxxxxx7[3;3H[m(B)BA8xxxxx[14;48H[;5m"
"(B)Bxxxxx7[3;4H[m(B)BA8xxxxx[14;60H[;7m(B)Bxx"
"xxx7[3;5H[m(B)BA8xxxxx[16;12H[;0m(0)B`````7[4;"
"1H[m(B)BA8`````[16;24H[;1m(0)B`````7[4;2H[m(B"
")BA8`````[16;36H[;4m(0)B`````7[4;3H[m(B)BA8```"
"``[16;48H[;5m(0)B`````7[4;4H[m(B)BA8`````[16;60"
"H[;7m(0)B`````7[4;5H[m(B)BA8`````[0m(B)B[21;"
"1HTest of the SAVE/RESTORE CURSOR feature. There shouldbe"
" ten characters of each flavour, and a rectangleof 5 x 4 "
"A's filling the top left of the screen.Push <RETURN>"))))
(ert-deftest nterm-vttest-3-1 ()
(should (nterm-ut
"18b51dfa49588dc112ce67c1e94a1e13" "f66e36acb4c92b5f5f37bb28798cf95e"
(concat
"[2J[?42l(B)B*B+B[1;"
"10HSelected as G0 (with SI)[1;48HSelected as G1 (with SO))"
"B(B[3;1H[1mCharacter set A (UK / national)[0m(A)B[4"
";10H !\"#$%&'()*+,-./0123456789:;<=>?[5;10H@ABCDEFGHIJKLMNOP"
"QRSTUVWXYZ[\]^_[6;10H`abcdefghijklmnopqrstuvwxyz{|}~)A(B"
"[4;48H !\"#$%&'()*+,-./0123456789:;<=>?[5;48H@ABCDEFGHIJKL"
"MNOPQRSTUVWXYZ[\]^_[6;48H`abcdefghijklmnopqrstuvwxyz{|}~)"
"B(B[7;1H[1mCharacter set B (US ASCII)[0m(B)B[8;10H "
"!\"#$%&'()*+,-./0123456789:;<=>?[9;10H@ABCDEFGHIJKLMNOPQRSTU"
"VWXYZ[\]^_[10;10H`abcdefghijklmnopqrstuvwxyz{|}~)B(B[8"
";48H !\"#$%&'()*+,-./0123456789:;<=>?[9;48H@ABCDEFGHIJKLMNOP"
"QRSTUVWXYZ[\]^_[10;48H`abcdefghijklmnopqrstuvwxyz{|}~)B("
"B[11;1H[1mCharacter set 0 (Special graphics and line draw"
"ing)[0m(0)B[12;10H !\"#$%&'()*+,-./0123456789:;<=>?[13;"
"10H@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_[14;10H`abcdefghijklmnop"
"qrstuvwxyz{|}~)0(B[12;48H !\"#$%&'()*+,-./0123456789:;<="
">?[13;48H@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_[14;48H`abcdefghi"
"jklmnopqrstuvwxyz{|}~)B(B[15;1H[1mCharacter set 1 (Alt"
"ernate character ROM standard characters)[0m(1)B[16;10H"
" !\"#$%&'()*+,-./0123456789:;<=>?[17;10H@ABCDEFGHIJKLMNOPQRS"
"TUVWXYZ[\]^_[18;10H`abcdefghijklmnopqrstuvwxyz{|}~)1(B"
"[16;48H !\"#$%&'()*+,-./0123456789:;<=>?[17;48H@ABCDEFGHIJKL"
"MNOPQRSTUVWXYZ[\]^_[18;48H`abcdefghijklmnopqrstuvwxyz{|}~"
")B(B[19;1H[1mCharacter set 2 (Alternate character ROM sp"
"ecial graphics)[0m(2)B[20;10H !\"#$%&'()*+,-./0123456789"
":;<=>?[21;10H@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_[22;10H`abcde"
"fghijklmnopqrstuvwxyz{|}~)2(B[20;48H !\"#$%&'()*+,-./012"
"3456789:;<=>?[21;48H@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_[22;48"
"H`abcdefghijklmnopqrstuvwxyz{|}~(B)B[24;1HThese are the"
" installed character sets. Push <RETURN>"))))
(ert-deftest nterm-vt100-ed-1 ()
"Test VT100 ED partial delete."
(should (nterm-ut
"200e3d98bfff785a3ae3c34b3e51bf8e" "3a6c01ada23aca922212b949e7beee53"
(concat
"#8"
"[10;20H1[1J"
"[20;30H1[0J"))))
(ert-deftest nterm-vt100-ed-2 ()
"Test VT100 ED complete delete.
Make sure the double width line gets resetted."
(nterm-ut
"16cc13d28218738d5d8688f7a4e0e4e5" "971a0e38dce04387a30cf29bfddfac4a"
"#8#6[2J"))
(ert-deftest nterm-vt100-ed-3 ()
"Test VT100 ED partial delete on double width line"
(nterm-ut
"9f535039ec87637af83c5812ce282af5" "3e4391164b1188c2ac007e49bf90d01d"
(concat
"#8#6"
"[10;20H#61[1J"
"[20;30H1#6[0J")))
(ert-deftest nterm-vt100-el ()
"Test VT100 EL.
Double line attribute should not be cleared. Test partial erase
with argument 0 and 1."
(should (nterm-ut
"3cc5918951990ccfc54e74a837310b2a" "dda2b65811ffb887c48153cec7a2282c"
(concat
"1234[0K"
"1234[1K"
"1234[2K"
"1234[3K"
"#61234[0K"
"#61234[1K"
"#61234[2K"))))
;; blink dwl breakage
;; [5m
;; [1;1H
;; [2J
;; #3T
;; Copyright (C) 2010 Ivan Kanis
;; Author: Ivan Kanis
;;
;; This program is free software ; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation ; either version 2 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY ; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program ; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA