robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1-- Test for :execute, :while and :if 2 3local n =require ( 'test.functional.testnvim' )() 4local t =require ( 'test.testutil' ) 5 6local describe , it , setup =t . describe , t . it , t . setup 7local clear =n . clear 8local expect =n . expect 9local source =n . source 10local command =n . command 11 12describe ( ':execute, :while and :if' , function () 13setup ( clear ) 14 15it ( 'is working' , function () 16source ( [[ 17let i = 0 18while i < 12 19let i = i + 1 20execute "normal o" . i . "\033" 21if i % 2 22normal Ax 23if i == 9 24break 25endif 26if i == 5 27continue 28else 29let j = 9 30while j > 0 31execute "normal" j . "a" . j . "\x1b" 32let j = j - 1 33endwhile 34endif 35endif 36if i == 9 37execute "normal Az\033" 38endif 39endwhile 40unlet i j 41]] ) 42 43-- Remove empty line 44command ( '1d' ) 45 46-- Assert buffer contents. 47expect ( [[ 481x999999999888888887777777666666555554444333221 492 503x999999999888888887777777666666555554444333221 514 525x 536 547x999999999888888887777777666666555554444333221 558 569x]] ) 57end ) 58end )