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 , after_each =t . describe , t . it , t . before_each , t . after_each 5local clear =n . clear 6local command =n . command 7local fn =n . fn 8local eq =t . eq 9 10describe ( 'mksession' , function () 11before_each ( clear ) 12 13after_each ( function () 14os . remove ( 'Xtest_mks.out' ) 15end ) 16 17it ( 'supports "skiprtp" value' , function () 18command ( 'set sessionoptions+=options' ) 19command ( 'set rtp+=$HOME' ) 20command ( 'set pp+=$HOME' ) 21command ( 'mksession! Xtest_mks.out' ) 22local found_rtp =0 23local found_pp =0 24for _ , line in pairs ( fn . readfile ( 'Xtest_mks.out' , 'b' )) do 25if line : find ( 'set runtimepath' ) then 26found_rtp =found_rtp + 1 27end 28if line : find ( 'set packpath' ) then 29found_pp =found_pp + 1 30end 31end 32eq ( 1 , found_rtp ) 33eq ( 1 , found_pp ) 34 35command ( 'set sessionoptions+=skiprtp' ) 36command ( 'mksession! Xtest_mks.out' ) 37local found_rtp_or_pp =0 38for _ , line in pairs ( fn . readfile ( 'Xtest_mks.out' , 'b' )) do 39if line : find ( 'set runtimepath' ) or line : find ( 'set packpath' ) then 40found_rtp_or_pp =found_rtp_or_pp + 1 41end 42end 43eq ( 0 , found_rtp_or_pp ) 44end ) 45end )