From 818fd4115f8242960c54dcc9d3474c47989fa1fd Mon Sep 17 00:00:00 2001 From: Daniel Poelzleithner Date: Fri, 11 Nov 2022 19:00:26 +0100 Subject: [PATCH] also test executable files --- tests/cron-rsync.lua | 4 ++++ tests/testlib.lua | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/cron-rsync.lua b/tests/cron-rsync.lua index 7be751f..2cfcb3e 100644 --- a/tests/cron-rsync.lua +++ b/tests/cron-rsync.lua @@ -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 diff --git a/tests/testlib.lua b/tests/testlib.lua index 9dac61d..9a5ecc0 100644 --- a/tests/testlib.lua +++ b/tests/testlib.lua @@ -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