add second tests of vttest

 

force file nterm-ut to be in unicode

File modified: lisp/nterm/nterm-ut.el

Change343 at Sun Aug 15 12:20:37 2010 +0200 by Ivan Kanis <ivan@tao>

diff -r f75db99a73be -r cdfa572df871 lisp/nterm/nterm-ut.el
--- a/lisp/nterm/nterm-ut.el	Sat Aug 14 13:33:56 2010 +0200
+++ b/lisp/nterm/nterm-ut.el	Sun Aug 15 12:20:37 2010 +0200
@@ -1,3 +1,4 @@
+;; -*-coding: utf-8 -*-
 ;;; nterm-ut.el --- nterm unit testing
 
 ;;; Commentary:
@@ -39,6 +40,8 @@
    (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"
@@ -180,6 +183,347 @@
 "0000004;0000000025HcePush <R"
 "ETURN>"))))
 
+;;; Test of screen features
+(ert-deftest nterm-vttest-2-1 ()
+  (should (nterm-ut 
+"ad8d360cca3dd644390124a846e397cd" "33c2707fe415cd6bd36fbe99279982cb"
+ (concat
+"
[?7h*******************************************"
+"************************************************************"
+"*********************************************************[?"
+"7l****************************************************"
+"************************************************************"
+"************************************************[?7hT"
+"his should be three identical lines of *'s completely fillin"
+"g

the 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
+""
+"HHHHHHHHH"
+"HHHHHHHHHH"
+"HHHHHHH"
+""
+"	*	*	*	*"
+"	*	*	*	*	*	*	*	*	*     *     *     *     *     *     *"
+"     *     *     *     *     *     *     *Test of TAB "
+"setting/resetting. These two lines

should look the same. P"
+"ush <RETURN>"))))
+
+(ert-deftest nterm-vttest-2-3 ()
+  (should (nterm-ut 
+"0bd1cae765007548eae21bd37f206a02" "13255ee965350900167b32473909fe99"
+ (concat
+"[?5h[?3hHHHH"
+"HHHHHHHHHH"
+"HHH123456789012345678901234567890123456"
+"789012345678901234567890123456789012345678901234567890123456"
+"78901234567890123456789012345678901This is 132 column "
+"mode, light background.This is 132 column mode, light "
+"background.This is 132 column mode, light background."
+"[6;6HThis is 132 column mode, light background.This is"
+" 132 column mode, light background.This is 132 column "
+"mode, light background.This is 132 column mode, light "
+"background.This is 132 column mode, light background"
+".This is 132 column mode, light background.T"
+"his is 132 column mode, light background.This is 132"
+" column mode, light background.This is 132 column mo"
+"de, light background.This is 132 column mode, light "
+"background.This is 132 column mode, light background"
+".This is 132 column mode, light background.T"
+"his is 132 column mode, light background.This is 132"
+" column mode, light background.This is 132 column mo"
+"de, light background.Push <RETURN>"))))
+
+(ert-deftest nterm-vttest-2-7 ()
+  (should (nterm-ut 
+"f70ca90ba5a60c526d2c66c0d9eac1c7" "d6f0b5ffd36573c384280a7e2ae7a63d"
+ (concat
+"[?6h[?4hSoft "
+"scroll up region [12..13] size 2 Line 1
Soft scroll up regi"
+"on [12..13] size 2 Line 2
Soft scroll up region [12..13] si"
+"ze 2 Line 3
Soft scroll up region [12..13] size 2 Line 4
S"
+"oft scroll up region [12..13] size 2 Line 5
Soft scroll up "
+"region [12..13] size 2 Line 6
Soft scroll up region [12..13"
+"] size 2 Line 7
Soft scroll up region [12..13] size 2 Line "
+"8
Soft scroll up region [12..13] size 2 Line 9
Soft scroll"
+" up region [12..13] size 2 Line 10
Soft scroll up region [1"
+"2..13] size 2 Line 11
Soft scroll up region [12..13] size 2"
+" Line 12
Soft scroll up region [12..13] size 2 Line 13
Sof"
+"t scroll up region [12..13] size 2 Line 14
Soft scroll up r"
+"egion [12..13] size 2 Line 15
Soft scroll up region [12..13"
+"] size 2 Line 16
Soft scroll up region [12..13] size 2 Line"
+" 17
Soft scroll up region [12..13] size 2 Line 18
Soft scr"
+"oll up region [12..13] size 2 Line 19
Soft scroll up region"
+" [12..13] size 2 Line 20
Soft scroll up region [12..13] siz"
+"e 2 Line 21
Soft scroll up region [12..13] size 2 Line 22
"
+"Soft scroll up region [12..13] size 2 Line 23
Soft scroll u"
+"p region [12..13] size 2 Line 24
Soft scroll up region [12."
+".13] size 2 Line 25
Soft scroll up region [12..13] size 2 L"
+"ine 26
Soft scroll up region [12..13] size 2 Line 27
Soft "
+"scroll up region [12..13] size 2 Line 28
Soft scroll up reg"
+"ion [12..13] size 2 Line 29
Soft scroll down region [1"
+"2..13] size 2 Line 1
MMSoft scroll down region [12..13] s"
+"ize 2 Line 2
MMSoft scroll down region [12..13] size 2 Li"
+"ne 3
MMSoft scroll down region [12..13] size 2 Line 4
M"
+"MSoft scroll down region [12..13] size 2 Line 5
MMSoft s"
+"croll down region [12..13] size 2 Line 6
MMSoft scroll do"
+"wn region [12..13] size 2 Line 7
MMSoft scroll down regio"
+"n [12..13] size 2 Line 8
MMSoft scroll down region [12..1"
+"3] size 2 Line 9
MMSoft scroll down region [12..13] size "
+"2 Line 10
MMSoft scroll down region [12..13] size 2 Line "
+"11
MMSoft scroll down region [12..13] size 2 Line 12
M"
+"MSoft scroll down region [12..13] size 2 Line 13
MMSoft s"
+"croll down region [12..13] size 2 Line 14
MMSoft scroll d"
+"own region [12..13] size 2 Line 15
MMSoft scroll down reg"
+"ion [12..13] size 2 Line 16
MMSoft scroll down region [12"
+"..13] size 2 Line 17
MMSoft scroll down region [12..13] s"
+"ize 2 Line 18
MMSoft scroll down region [12..13] size 2 L"
+"ine 19
MMSoft scroll down region [12..13] size 2 Line 20
"
+"MMSoft scroll down region [12..13] size 2 Line 21
MMSo"
+"ft scroll down region [12..13] size 2 Line 22
MMSoft scro"
+"ll down region [12..13] size 2 Line 23
MMSoft scroll down"
+" region [12..13] size 2 Line 24
MMSoft scroll down region"
+" [12..13] size 2 Line 25
MMSoft scroll down region [12..1"
+"3] size 2 Line 26
MMSoft scroll down region [12..13] size"
+" 2 Line 27
MMSoft scroll down region [12..13] size 2 Line"
+" 28
MMSoft scroll down region [12..13] size 2 Line 29
M"
+"MPush <RETURN>"))))
+
+(ert-deftest nterm-vttest-2-8 ()
+  (should (nterm-ut 
+"57237d69771a6593eb105eb152bb0549" "fecd5cbe33f4903d12007abe3f80e063"
+ (concat
+"Soft scroll up region [1..24] size 24 Line"
+" 1
Soft scroll up region [1..24] size 24 Line 2
Soft scrol"
+"l up region [1..24] size 24 Line 3
Soft scroll up region [1"
+"..24] size 24 Line 4
Soft scroll up region [1..24] size 24 "
+"Line 5
Soft scroll up region [1..24] size 24 Line 6
Soft s"
+"croll up region [1..24] size 24 Line 7
Soft scroll up regio"
+"n [1..24] size 24 Line 8
Soft scroll up region [1..24] size"
+" 24 Line 9
Soft scroll up region [1..24] size 24 Line 10
S"
+"oft scroll up region [1..24] size 24 Line 11
Soft scroll up"
+" region [1..24] size 24 Line 12
Soft scroll up region [1..2"
+"4] size 24 Line 13
Soft scroll up region [1..24] size 24 Li"
+"ne 14
Soft scroll up region [1..24] size 24 Line 15
Soft s"
+"croll up region [1..24] size 24 Line 16
Soft scroll up regi"
+"on [1..24] size 24 Line 17
Soft scroll up region [1..24] si"
+"ze 24 Line 18
Soft scroll up region [1..24] size 24 Line 19"
+"
Soft scroll up region [1..24] size 24 Line 20
Soft scroll"
+" up region [1..24] size 24 Line 21
Soft scroll up region [1"
+"..24] size 24 Line 22
Soft scroll up region [1..24] size 24"
+" Line 23
Soft scroll up region [1..24] size 24 Line 24
Sof"
+"t scroll up region [1..24] size 24 Line 25
Soft scroll up r"
+"egion [1..24] size 24 Line 26
Soft scroll up region [1..24]"
+" size 24 Line 27
Soft scroll up region [1..24] size 24 Line"
+" 28
Soft scroll up region [1..24] size 24 Line 29
Sof"
+"t scroll down region [1..24] size 24 Line 1
MMSoft scroll"
+" down region [1..24] size 24 Line 2
MMSoft scroll down re"
+"gion [1..24] size 24 Line 3
MMSoft scroll down region [1."
+".24] size 24 Line 4
MMSoft scroll down region [1..24] siz"
+"e 24 Line 5
MMSoft scroll down region [1..24] size 24 Lin"
+"e 6
MMSoft scroll down region [1..24] size 24 Line 7
M"
+"MSoft scroll down region [1..24] size 24 Line 8
MMSoft sc"
+"roll down region [1..24] size 24 Line 9
MMSoft scroll dow"
+"n region [1..24] size 24 Line 10
MMSoft scroll down regio"
+"n [1..24] size 24 Line 11
MMSoft scroll down region [1..2"
+"4] size 24 Line 12
MMSoft scroll down region [1..24] size"
+" 24 Line 13
MMSoft scroll down region [1..24] size 24 Lin"
+"e 14
MMSoft scroll down region [1..24] size 24 Line 15
"
+"MMSoft scroll down region [1..24] size 24 Line 16
MMSoft"
+" scroll down region [1..24] size 24 Line 17
MMSoft scroll"
+" down region [1..24] size 24 Line 18
MMSoft scroll down r"
+"egion [1..24] size 24 Line 19
MMSoft scroll down region ["
+"1..24] size 24 Line 20
MMSoft scroll down region [1..24] "
+"size 24 Line 21
MMSoft scroll down region [1..24] size 24"
+" Line 22
MMSoft scroll down region [1..24] size 24 Line 2"
+"3
MMSoft scroll down region [1..24] size 24 Line 24
MM"
+"Soft scroll down region [1..24] size 24 Line 25
MMSoft sc"
+"roll down region [1..24] size 24 Line 26
MMSoft scroll do"
+"wn region [1..24] size 24 Line 27
MMSoft scroll down regi"
+"on [1..24] size 24 Line 28
MMSoft scroll down region [1.."
+"24] size 24 Line 29
MMPush <RETURN>"))))
+
+(ert-deftest nterm-vttest-2-9 ()
+  (should (nterm-ut 
+"ce90d4034120133556b3570be638ebd8" "db7c7631cc5ccfdcd51deb3ac0243dda"
+ (concat
+"[?4l"
+"Jump scroll up region [12..13] size 2 Line 1
Jump scroll up"
+" region [12..13] size 2 Line 2
Jump scroll up region [12..1"
+"3] size 2 Line 3
Jump scroll up region [12..13] size 2 Line"
+" 4
Jump scroll up region [12..13] size 2 Line 5
Jump scrol"
+"l up region [12..13] size 2 Line 6
Jump scroll up region [1"
+"2..13] size 2 Line 7
Jump scroll up region [12..13] size 2 "
+"Line 8
Jump scroll up region [12..13] size 2 Line 9
Jump s"
+"croll up region [12..13] size 2 Line 10
Jump scroll up regi"
+"on [12..13] size 2 Line 11
Jump scroll up region [12..13] s"
+"ize 2 Line 12
Jump scroll up region [12..13] size 2 Line 13"
+"
Jump scroll up region [12..13] size 2 Line 14
Jump scroll"
+" up region [12..13] size 2 Line 15
Jump scroll up region [1"
+"2..13] size 2 Line 16
Jump scroll up region [12..13] size 2"
+" Line 17
Jump scroll up region [12..13] size 2 Line 18
Jum"
+"p scroll up region [12..13] size 2 Line 19
Jump scroll up r"
+"egion [12..13] size 2 Line 20
Jump scroll up region [12..13"
+"] size 2 Line 21
Jump scroll up region [12..13] size 2 Line"
+" 22
Jump scroll up region [12..13] size 2 Line 23
Jump scr"
+"oll up region [12..13] size 2 Line 24
Jump scroll up region"
+" [12..13] size 2 Line 25
Jump scroll up region [12..13] siz"
+"e 2 Line 26
Jump scroll up region [12..13] size 2 Line 27
"
+"Jump scroll up region [12..13] size 2 Line 28
Jump scroll u"
+"p region [12..13] size 2 Line 29
Jump scroll down regi"
+"on [12..13] size 2 Line 1
MMJump scroll down region [12.."
+"13] size 2 Line 2
MMJump scroll down region [12..13] size"
+" 2 Line 3
MMJump scroll down region [12..13] size 2 Line "
+"4
MMJump scroll down region [12..13] size 2 Line 5
MMJ"
+"ump scroll down region [12..13] size 2 Line 6
MMJump scro"
+"ll down region [12..13] size 2 Line 7
MMJump scroll down "
+"region [12..13] size 2 Line 8
MMJump scroll down region ["
+"12..13] size 2 Line 9
MMJump scroll down region [12..13] "
+"size 2 Line 10
MMJump scroll down region [12..13] size 2 "
+"Line 11
MMJump scroll down region [12..13] size 2 Line 12"
+"
MMJump scroll down region [12..13] size 2 Line 13
MMJ"
+"ump scroll down region [12..13] size 2 Line 14
MMJump scr"
+"oll down region [12..13] size 2 Line 15
MMJump scroll dow"
+"n region [12..13] size 2 Line 16
MMJump scroll down regio"
+"n [12..13] size 2 Line 17
MMJump scroll down region [12.."
+"13] size 2 Line 18
MMJump scroll down region [12..13] siz"
+"e 2 Line 19
MMJump scroll down region [12..13] size 2 Lin"
+"e 20
MMJump scroll down region [12..13] size 2 Line 21
"
+"MMJump scroll down region [12..13] size 2 Line 22
MMJump"
+" scroll down region [12..13] size 2 Line 23
MMJump scroll"
+" down region [12..13] size 2 Line 24
MMJump scroll down r"
+"egion [12..13] size 2 Line 25
MMJump scroll down region ["
+"12..13] size 2 Line 26
MMJump scroll down region [12..13]"
+" size 2 Line 27
MMJump scroll down region [12..13] size 2"
+" Line 28
MMJump scroll down region [12..13] size 2 Line 2"
+"9
MMPush <RETURN>"))))
+
+(ert-deftest nterm-vttest-2-8 ()
+  (should (nterm-ut 
+"f6c6e5734a13c0d8a8443188d1467c7c" "2c7729fcec5c92cb915ba7456e41ed1e"
+ (concat
+"Jump scroll up region [1"
+"..24] size 24 Line 1
Jump scroll up region [1..24] size 24 "
+"Line 2
Jump scroll up region [1..24] size 24 Line 3
Jump s"
+"croll up region [1..24] size 24 Line 4
Jump scroll up regio"
+"n [1..24] size 24 Line 5
Jump scroll up region [1..24] size"
+" 24 Line 6
Jump scroll up region [1..24] size 24 Line 7
Ju"
+"mp scroll up region [1..24] size 24 Line 8
Jump scroll up r"
+"egion [1..24] size 24 Line 9
Jump scroll up region [1..24] "
+"size 24 Line 10
Jump scroll up region [1..24] size 24 Line "
+"11
Jump scroll up region [1..24] size 24 Line 12
Jump scro"
+"ll up region [1..24] size 24 Line 13
Jump scroll up region "
+"[1..24] size 24 Line 14
Jump scroll up region [1..24] size "
+"24 Line 15
Jump scroll up region [1..24] size 24 Line 16
J"
+"ump scroll up region [1..24] size 24 Line 17
Jump scroll up"
+" region [1..24] size 24 Line 18
Jump scroll up region [1..2"
+"4] size 24 Line 19
Jump scroll up region [1..24] size 24 Li"
+"ne 20
Jump scroll up region [1..24] size 24 Line 21
Jump s"
+"croll up region [1..24] size 24 Line 22
Jump scroll up regi"
+"on [1..24] size 24 Line 23
Jump scroll up region [1..24] si"
+"ze 24 Line 24
Jump scroll up region [1..24] size 24 Line 25"
+"
Jump scroll up region [1..24] size 24 Line 26
Jump scroll"
+" up region [1..24] size 24 Line 27
Jump scroll up region [1"
+"..24] size 24 Line 28
Jump scroll up region [1..24] size 24"
+" Line 29
Jump scroll down region [1..24] size 24 Line "
+"1
MMJump scroll down region [1..24] size 24 Line 2
MMJ"
+"ump scroll down region [1..24] size 24 Line 3
MMJump scro"
+"ll down region [1..24] size 24 Line 4
MMJump scroll down "
+"region [1..24] size 24 Line 5
MMJump scroll down region ["
+"1..24] size 24 Line 6
MMJump scroll down region [1..24] s"
+"ize 24 Line 7
MMJump scroll down region [1..24] size 24 L"
+"ine 8
MMJump scroll down region [1..24] size 24 Line 9
"
+"MMJump scroll down region [1..24] size 24 Line 10
MMJump"
+" scroll down region [1..24] size 24 Line 11
MMJump scroll"
+" down region [1..24] size 24 Line 12
MMJump scroll down r"
+"egion [1..24] size 24 Line 13
MMJump scroll down region ["
+"1..24] size 24 Line 14
MMJump scroll down region [1..24] "
+"size 24 Line 15
MMJump scroll down region [1..24] size 24"
+" Line 16
MMJump scroll down region [1..24] size 24 Line 1"
+"7
MMJump scroll down region [1..24] size 24 Line 18
MM"
+"Jump scroll down region [1..24] size 24 Line 19
MMJump sc"
+"roll down region [1..24] size 24 Line 20
MMJump scroll do"
+"wn region [1..24] size 24 Line 21
MMJump scroll down regi"
+"on [1..24] size 24 Line 22
MMJump scroll down region [1.."
+"24] size 24 Line 23
MMJump scroll down region [1..24] siz"
+"e 24 Line 24
MMJump scroll down region [1..24] size 24 Li"
+"ne 25
MMJump scroll down region [1..24] size 24 Line 26
"
+"MMJump scroll down region [1..24] size 24 Line 27
MMJum"
+"p scroll down region [1..24] size 24 Line 28
MMJump scrol"
+"l down region [1..24] size 24 Line 29
MMPush <RETURN>"))))
+
+(ert-deftest nterm-vttest-2-9 ()
+  (should (nterm-ut
+"be9e1cda05e462b8741b1e170421d8eb" "4e73d78f3c4e0914862fcbb1f14d3bb8"
+ (concat
+"[?6h"
+"
Origin mode test. This line should be at the botto"
+"m of the screen.This 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
+"[?6lOrigin 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
+"Graphic rendition test pattern:[0"
+"mvanillaboldunderline[4"
+"mbold underlineblinkbold blink[1"
+"0;6Hunderline blinkbold underline "
+"blinknegativebold negativ"
+"eunderline negativebold und"
+"erline negativeblink negative[0;1"
+";5;7mbold blink negativeunderline blink neg"
+"ativebold underline blink negative[?"
+"5lDark background. Push <RETURN>"))))
+
+(ert-deftest nterm-vttest-2-14 ()
+  (should (nterm-ut
+"def090a2fe1a7a51c953ce8dd4a10343" "2f37168f73de511effd3f6d40b7b0e63"
+ (concat
+"[?5lnormalb"
+"oldunderscoredblinkingreversedst"
+"ars:line:x'es:diamonds:(B"
+")B*****7(B)BA8*****(B)B*****"
+"7(B)BA8*****(B)B*****7"
+"[m(B)BA8*****(B)B*****7(B)B"
+"A8*****(B)B*****7(B)BA8*****"
+"[12;12H(0)Bqqqqq7(B)BA8qqqqq["
+";1m(0)Bqqqqq7(B)BA8qqqqq(0)B"
+"qqqqq7(B)BA8qqqqq(0)Bqqqqq7"
+"[2;4H(B)BA8qqqqq(0)Bqqqqq7"
+"(B)BA8qqqqq(B)Bxxxxx7(B)BA8"
+"xxxxx(B)Bxxxxx7(B)BA8xxxxx[14"
+";36H(B)Bxxxxx7(B)BA8xxxxx"
+"(B)Bxxxxx7(B)BA8xxxxx(B)Bxx"
+"xxx7(B)BA8xxxxx(0)B`````7[4;"
+"1H(B)BA8`````(0)B`````7(B"
+")BA8`````(0)B`````7(B)BA8```"
+"``(0)B`````7(B)BA8`````[16;60"
+"H(0)B`````7(B)BA8`````(B)B[21;"
+"1HTest of the SAVE/RESTORE CURSOR feature. There should

be"
+" ten characters of each flavour, and a rectangle

of 5 x 4 "
+"A's filling the top left of the screen.

Push <RETURN>"))))
+
+(ert-deftest nterm-clear-double-width ()
+  "Write a double underlined line an then clear it.
+There should be a blank screen with no attribute."
+  (should (nterm-ut
+           "16cc13d28218738d5d8688f7a4e0e4e5" "971a0e38dce04387a30cf29bfddfac4a"
+           "#6d")))
+
 ;; Copyright (C) 2010 Ivan Kanis
 ;; Author: Ivan Kanis
 ;;


back