robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1-- Tests for writefile() 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 , command , expect =n . clear , n . command , n . expect 8 9describe ( 'writefile' , function () 10setup ( clear ) 11 12it ( 'is working' , function () 13command ( '%delete _' ) 14command ( 'let f = tempname()' ) 15command ( 'call writefile(["over","written"], f, "b")' ) 16command ( 'call writefile(["hello","world"], f, "b")' ) 17command ( 'call writefile(["!", "good"], f, "a")' ) 18command ( 'call writefile(["morning"], f, "ab")' ) 19command ( 'call writefile(["", "vimmers"], f, "ab")' ) 20command ( 'bwipeout!' ) 21command ( '$put =readfile(f)' ) 22command ( '1 delete _' ) 23command ( 'call delete(f)' ) 24 25-- Assert buffer contents. 26expect ( [[ 27hello 28world! 29good 30morning 31vimmers]] ) 32end ) 33end )