robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1-- Tests for adjusting window and contents 2 3local n =require ( 'test.functional.testnvim' )() 4local t =require ( 'test.testutil' ) 5local Screen =require ( 'test.functional.ui.screen' ) 6 7local describe , it , setup =t . describe , t . it , t . setup 8local poke_eventloop =n . poke_eventloop 9local clear =n . clear 10local insert =n . insert 11local command =n . command 12 13describe ( '107' , function () 14setup ( clear ) 15 16it ( 'is working' , function () 17local screen =Screen . new () 18 19insert ( 'start:' ) 20poke_eventloop () 21command ( 'new' ) 22command ( 'call setline(1, range(1,256))' ) 23command ( 'let r=[]' ) 24command ( [[ 25func! GetScreenStr(row) 26let str = "" 27for c in range(1,3) 28let str .= nr2char(screenchar(a:row, c)) 29endfor 30return str 31endfunc 32]] ) 33command ( [[exe ":norm! \<C-W>t\<C-W>=1Gzt\<C-W>w\<C-W>+"]] ) 34command ( 'let s3=GetScreenStr(1)' ) 35command ( 'wincmd p' ) 36command ( 'call add(r, [line("w0"), s3])' ) 37command ( [[exe ":norm! \<C-W>t\<C-W>=50Gzt\<C-W>w\<C-W>+"]] ) 38command ( 'let s3=GetScreenStr(1)' ) 39command ( 'wincmd p' ) 40command ( 'call add(r, [line("w0"), s3])' ) 41command ( [[exe ":norm! \<C-W>t\<C-W>=59Gzt\<C-W>w\<C-W>+"]] ) 42command ( 'let s3=GetScreenStr(1)' ) 43command ( ':wincmd p' ) 44command ( 'call add(r, [line("w0"), s3])' ) 45command ( 'bwipeout!' ) 46command ( '$put=r' ) 47command ( 'call garbagecollect(1)' ) 48 49screen : expect ( [[ 50start: | 51[1, '1 '] | 52[50, '50 '] | 53^[59, '59 '] | 54{1:~ }|*9 553 more lines | 56]] ) 57end ) 58end )