summaryrefslogtreecommitdiff
path: root/src/granger/test/test-os-access.lua
blob: 60740c4f8b7c0543203a9baa6fa97422974ff07f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--
-- test-os-access.lua
-- test case for os.access()
-- Copyright (c) 2016 Jeff Kent <jeff@jkent.net>
--

print "os.access() test begin"

if not os.is("windows") then
    p = os.tmpname()
	os.execute("touch " .. p .. "; chmod 400 " .. p)
	assert(os.access(p, "r") == true)
	assert(os.access(p, "w") == false)
	os.execute("rm -f " .. p)
end

print "os.access() test end"