fileid: rename os_get_file_id

This commit is contained in:
Stefan Hoffmann
2014-08-27 20:09:39 +02:00
parent 8a66f4f245
commit 4e43095ab2
6 changed files with 19 additions and 19 deletions

View File

@@ -646,16 +646,16 @@ describe('fs function', function()
end)
end)
describe('os_get_file_id', function()
describe('os_fileid', function()
it('returns false if given an non-existing file', function()
local file_id = file_id_new()
assert.is_false((fs.os_get_file_id('/non-existent', file_id)))
assert.is_false((fs.os_fileid('/non-existent', file_id)))
end)
it('returns true if given an existing file and fills file_id', function()
local file_id = file_id_new()
local path = 'unit-test-directory/test.file'
assert.is_true((fs.os_get_file_id(path, file_id)))
assert.is_true((fs.os_fileid(path, file_id)))
assert.is_true(0 < file_id[0].inode)
assert.is_true(0 < file_id[0].device_id)
end)
@@ -665,7 +665,7 @@ describe('fs function', function()
it('returns true if two FileIDs are equal', function()
local file_id = file_id_new()
local path = 'unit-test-directory/test.file'
assert.is_true((fs.os_get_file_id(path, file_id)))
assert.is_true((fs.os_fileid(path, file_id)))
assert.is_true((fs.os_file_id_equal(file_id, file_id)))
end)
@@ -674,8 +674,8 @@ describe('fs function', function()
local file_id_2 = file_id_new()
local path_1 = 'unit-test-directory/test.file'
local path_2 = 'unit-test-directory/test_2.file'
assert.is_true((fs.os_get_file_id(path_1, file_id_1)))
assert.is_true((fs.os_get_file_id(path_2, file_id_2)))
assert.is_true((fs.os_fileid(path_1, file_id_1)))
assert.is_true((fs.os_fileid(path_2, file_id_2)))
assert.is_false((fs.os_file_id_equal(file_id_1, file_id_2)))
end)
end)
@@ -685,7 +685,7 @@ describe('fs function', function()
local file_id = file_id_new()
local file_info = file_info_new()
local path = 'unit-test-directory/test.file'
assert.is_true((fs.os_get_file_id(path, file_id)))
assert.is_true((fs.os_fileid(path, file_id)))
assert.is_true((fs.os_fileinfo(path, file_info)))
assert.is_true((fs.os_file_id_equal_file_info(file_id, file_info)))
end)
@@ -695,7 +695,7 @@ describe('fs function', function()
local file_info = file_info_new()
local path_1 = 'unit-test-directory/test.file'
local path_2 = 'unit-test-directory/test_2.file'
assert.is_true((fs.os_get_file_id(path_1, file_id)))
assert.is_true((fs.os_fileid(path_1, file_id)))
assert.is_true((fs.os_fileinfo(path_2, file_info)))
assert.is_false((fs.os_file_id_equal_file_info(file_id, file_info)))
end)