adjust getDirectoryItems and getInfo behavior with nonexistent files

This commit is contained in:
Grump
2020-05-11 20:36:36 +02:00
parent 77346734b5
commit 40a4cb62d3
2 changed files with 8 additions and 2 deletions

View File

@@ -134,6 +134,8 @@ function test_fs_getDirectoryItems()
for i = 1, #items2 do
equals(map[items2[i]], map2[items2[i]])
end
equals(#fs.getDirectoryItems('does_not_exist'), 0)
end
function test_fs_setWorkingDirectory()
@@ -172,6 +174,8 @@ function test_fs_getInfo()
notEquals(info, nil)
equals(info.type, 'file')
equals(fs.getInfo('does_not_exist', nil))
local info = fs.getInfo(testFile1)
notEquals(info, nil)
equals(info.type, 'file')