robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1local t =require ( 'test.unit.testutil' ) 2local describe =t . describe 3local itp =t . gen_itp ( t . it ) 4 5local to_cstr =t . to_cstr 6local eq =t . eq 7 8local optionstr =t . cimport ( './src/nvim/optionstr.h' ) 9 10local check_ff_value =function ( ff ) 11return optionstr . check_ff_value ( to_cstr ( ff )) 12end 13 14describe ( 'check_ff_value' , function () 15itp ( 'views empty string as invalid' , function () 16eq ( 0 , check_ff_value ( '' )) 17end ) 18 19itp ( 'views "unix", "dos" and "mac" as valid' , function () 20eq ( 1 , check_ff_value ( 'unix' )) 21eq ( 1 , check_ff_value ( 'dos' )) 22eq ( 1 , check_ff_value ( 'mac' )) 23end ) 24 25itp ( 'views "foo" as invalid' , function () 26eq ( 0 , check_ff_value ( 'foo' )) 27end ) 28end )