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;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" +"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 +"[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 lines should 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 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 [24ASoft 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 +"[1;24r[2J[24BSoft 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 [24ASof" +"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[12;13r[2J[24B" +"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 [24AJump 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 +"[1;24r[2J[24BJump 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 [24AJump 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[2J" +"[23;24r Origin 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 +"def090a2fe1a7a51c953ce8dd4a10343" "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 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" + "[2K#6d[2J"))) + ;; Copyright (C) 2010 Ivan Kanis ;; Author: Ivan Kanis ;;