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 eval =n . eval 7local clear =n . clear 8local fn =n . fn 9local testprg =n . testprg 10 11describe ( 'xxd' , function () 12before_each ( clear ) 13 14it ( 'works' , function () 15t . skip ( t . is_arch ( 's390x' ), 'FIXME: xxd not built correctly on s390x with QEMU?' ) 16-- Round-trip test: encode then decode should return original 17local input ='hello' 18local encoded =fn . system ( { testprg ( 'xxd' ) } , input ) 19local decoded =fn . system ( { testprg ( 'xxd' ), '-r' } , encoded ) 20eq ( input , decoded ) 21end ) 22 23it ( 'handles long lines in revert mode' , function () 24t . skip ( t . is_arch ( 's390x' ), 'FIXME: xxd not built correctly on s390x with QEMU?' ) 25local long_line =( '4' ): rep ( 512 ) .. '\n' 26fn . system ( { testprg ( 'xxd' ), '-r' } , long_line ) 27eq ( 0 , eval ( 'v:shell_error' )) 28end ) 29end )