robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1local n =require ( 'test.functional.testnvim' )() 2local t =require ( 'test.testutil' ) 3local Screen =require ( 'test.functional.ui.screen' ) 4 5local describe , it , before_each =t . describe , t . it , t . before_each 6local feed =n . feed 7local clear =n . clear 8 9describe ( ':debug' , function () 10local screen 11before_each ( function () 12clear () 13screen =Screen . new ( 30 , 14 ) 14screen : set_default_attr_ids ( { 15[ 1 ] ={ bold =true , foreground =Screen . colors . Blue1 } , 16[ 2 ] ={ bold =true , reverse =true } , 17[ 3 ] ={ foreground =Screen . colors . Grey100 , background =Screen . colors . Red } , 18[ 4 ] ={ bold =true , foreground =Screen . colors . SeaGreen4 } , 19} ) 20end ) 21it ( 'scrolls messages correctly' , function () 22feed ( ':echoerr bork<cr>' ) 23screen : expect ( [[ 24| 25{1:~ }|*8 26{2: }| 27{3:E121: Undefined variable: bork}| 28| 29{4:Press ENTER or type command to}| 30{4: continue}^ | 31]] ) 32 33feed ( ':debug echo "aa"| echo "bb"<cr>' ) 34screen : expect ( [[ 35| 36{1:~ }|*5 37{2: }| 38{3:E121: Undefined variable: bork}| 39| 40{4:Press ENTER or type command to}| 41Entering Debug mode. Type "co| 42nt" to continue. | 43cmd: echo "aa"| echo "bb" | 44>^ | 45]] ) 46 47feed ( 'step<cr>' ) 48screen : expect ( [[ 49| 50{1:~ }|*2 51{2: }| 52{3:E121: Undefined variable: bork}| 53| 54{4:Press ENTER or type command to}| 55Entering Debug mode. Type "co| 56nt" to continue. | 57cmd: echo "aa"| echo "bb" | 58>step | 59aa | 60cmd: echo "bb" | 61>^ | 62]] ) 63 64feed ( 'step<cr>' ) 65screen : expect ( [[ 66{2: }| 67{3:E121: Undefined variable: bork}| 68| 69{4:Press ENTER or type command to}| 70Entering Debug mode. Type "co| 71nt" to continue. | 72cmd: echo "aa"| echo "bb" | 73>step | 74aa | 75cmd: echo "bb" | 76>step | 77bb | 78{4:Press ENTER or type command to}| 79{4: continue}^ | 80]] ) 81 82feed ( '<cr>' ) 83screen : expect ( [[ 84^ | 85{1:~ }|*12 86| 87]] ) 88end ) 89end )