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 =t . describe , t . it , t . before_each 5local eq =t . eq 6local ok =t . ok 7local call =n . call 8local clear =n . clear 9local is_os =t . is_os 10 11describe ( 'hostname()' , function () 12before_each ( clear ) 13 14it ( 'returns hostname string' , function () 15local actual =call ( 'hostname' ) 16ok ( string . len ( actual ) > 0 ) 17if call ( 'executable' , 'hostname' ) == 1 then 18local expected =string . gsub ( call ( 'system' , 'hostname' ), '[\n\r]' , '' ) 19eq ( 20( is_os ( 'win' ) and expected : upper () or expected ), 21( is_os ( 'win' ) and actual : upper () or actual ) 22) 23end 24end ) 25end )