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 clear , command =n . clear , n . command 9local insert =n . insert 10 11describe ( '063: Test for ":match", "matchadd()" and related functions' , function () 12setup ( clear ) 13 14it ( 'is working' , function () 15local screen =Screen . new ( 40 , 5 ) 16 17command ( 'highlight MyGroup1 term=bold ctermbg=red guibg=red' ) 18command ( 'highlight MyGroup2 term=italic ctermbg=green guibg=green' ) 19command ( 'highlight MyGroup3 term=underline ctermbg=blue guibg=blue' ) 20 21-- Check that "matchaddpos()" positions matches correctly 22insert ( 'abcdefghijklmnopq' ) 23command ( "call matchaddpos('MyGroup1', [[1, 5], [1, 8, 3]], 10, 3)" ) 24screen : expect ( [[ 25abcd{30:e}fg{30:hij}klmnop^q | 26{1:~ }|*3 27| 28]] ) 29 30command ( 'call clearmatches()' ) 31command ( "call setline(1, 'abcdΣabcdef')" ) 32command ( "call matchaddpos('MyGroup1', [[1, 4, 2], [1, 9, 2]])" ) 33screen : expect ( [[ 34abc{30:dΣ}ab{30:cd}e^f | 35{1:~ }|*3 36| 37]] ) 38end ) 39end )