test/os/fs: fix call to lfs.attributes

The second argument to lfs.attributes() serves only to select a specific
part of the normally returned table. It's not a file open flag (e.g.: as for
fopen() in C). Also made the (n)eq checks a bit more idiomatic.

Fixes #1831
This commit is contained in:
Nicolas Hillegeer 2015-01-16 21:41:33 +01:00
parent 401d738597
commit dd25b2e5ae

View File

@ -33,11 +33,11 @@ local absolute_executable = nil
local executable_name = nil local executable_name = nil
local function assert_file_exists(filepath) local function assert_file_exists(filepath)
eq(false, nil == (lfs.attributes(filepath, 'r'))) neq(nil, lfs.attributes(filepath))
end end
local function assert_file_does_not_exist(filepath) local function assert_file_does_not_exist(filepath)
eq(true, nil == (lfs.attributes(filepath, 'r'))) eq(nil, lfs.attributes(filepath))
end end
describe('fs function', function() describe('fs function', function()