mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-12-04 19:03:17 +00:00
also test executable files
This commit is contained in:
parent
f4c15496dc
commit
818fd4115f
@ -62,6 +62,8 @@ local function writefiles
|
||||
writefile( srcdir .. 'xbx/a', 'xbxa' )
|
||||
posix.mkdir( srcdir .. 'xcx' )
|
||||
writefile( srcdir .. 'xcx/x', 'xcxx' )
|
||||
writefile( srcdir .. 'xda', 'xda', '700' )
|
||||
writefile( srcdir .. 'xdb', 'xdb', '755' )
|
||||
end
|
||||
|
||||
-- test all files
|
||||
@ -72,6 +74,8 @@ local function testfiles
|
||||
testfile( trgdir .. 'yaa', false )
|
||||
testfile( trgdir .. 'xbx/a', false )
|
||||
testfile( trgdir .. 'xcx/x', true )
|
||||
testfile( trgdir .. 'xda', true )
|
||||
testfile( trgdir .. 'xdb', true )
|
||||
end
|
||||
|
||||
|
||||
|
@ -104,7 +104,8 @@ end
|
||||
function writefile
|
||||
(
|
||||
filename,
|
||||
text
|
||||
text,
|
||||
mode
|
||||
)
|
||||
local f = io.open( filename, 'w' )
|
||||
|
||||
@ -118,6 +119,10 @@ function writefile
|
||||
f:write( '\n' )
|
||||
f:close( )
|
||||
|
||||
if mode ~= nil then
|
||||
posix.chmod(filename, mode)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user