robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1local t =require ( 'test.testutil' ) 2local n =require ( 'test.functional.testnvim' )() 3 4local describe , it , before_each =t . describe , t . it , t . before_each 5local eq =t . eq 6local eval =n . eval 7local feed =n . feed 8local clear =n . clear 9local command =n . command 10 11describe ( 'v:count/v:count1' , function () 12before_each ( function () 13clear () 14 15command ( 'map <silent> _x :<C-u>let g:count = "v:count=". v:count .", v:count1=". v:count1<CR>' ) 16end ) 17 18describe ( 'in cmdwin' , function () 19it ( 'equal 0/1 when no count is given' , function () 20feed ( 'q:_x' ) 21eq ( 'v:count=0, v:count1=1' , eval ( 'g:count' )) 22end ) 23 24it ( 'equal 2/2 when count of 2 is given' , function () 25feed ( 'q:2_x' ) 26eq ( 'v:count=2, v:count1=2' , eval ( 'g:count' )) 27end ) 28end ) 29 30describe ( 'in normal mode' , function () 31it ( 'equal 0/1 when no count is given' , function () 32feed ( '_x' ) 33eq ( 'v:count=0, v:count1=1' , eval ( 'g:count' )) 34end ) 35 36it ( 'equal 2/2 when count of 2 is given' , function () 37feed ( '2_x' ) 38eq ( 'v:count=2, v:count1=2' , eval ( 'g:count' )) 39end ) 40end ) 41end )