mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
fileinfo: rename os_file_info_get_id
This commit is contained in:
@@ -1224,7 +1224,7 @@ static int cs_insert_filelist(char *fname, char *ppath, char *flags,
|
|||||||
} else
|
} else
|
||||||
csinfo[i].flags = NULL;
|
csinfo[i].flags = NULL;
|
||||||
|
|
||||||
os_file_info_get_id(file_info, &(csinfo[i].file_id));
|
os_fileinfo_id(file_info, &(csinfo[i].file_id));
|
||||||
return i;
|
return i;
|
||||||
} /* cs_insert_filelist */
|
} /* cs_insert_filelist */
|
||||||
|
|
||||||
|
@@ -378,7 +378,7 @@ bool os_fileinfo_id_equal(const FileInfo *file_info_1,
|
|||||||
///
|
///
|
||||||
/// @param file_info Pointer to the `FileInfo`
|
/// @param file_info Pointer to the `FileInfo`
|
||||||
/// @param[out] file_id Pointer to a `FileID`
|
/// @param[out] file_id Pointer to a `FileID`
|
||||||
void os_file_info_get_id(const FileInfo *file_info, FileID *file_id)
|
void os_fileinfo_id(const FileInfo *file_info, FileID *file_id)
|
||||||
{
|
{
|
||||||
file_id->inode = file_info->stat.st_ino;
|
file_id->inode = file_info->stat.st_ino;
|
||||||
file_id->device_id = file_info->stat.st_dev;
|
file_id->device_id = file_info->stat.st_dev;
|
||||||
|
@@ -576,13 +576,13 @@ describe('fs function', function()
|
|||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('os_file_info_get_id', function()
|
describe('os_fileinfo_id', function()
|
||||||
it('extracts ino/dev from file_info into file_id', function()
|
it('extracts ino/dev from file_info into file_id', function()
|
||||||
local file_info = file_info_new()
|
local file_info = file_info_new()
|
||||||
local file_id = file_id_new()
|
local file_id = file_id_new()
|
||||||
local path = 'unit-test-directory/test.file'
|
local path = 'unit-test-directory/test.file'
|
||||||
assert.is_true((fs.os_fileinfo(path, file_info)))
|
assert.is_true((fs.os_fileinfo(path, file_info)))
|
||||||
fs.os_file_info_get_id(file_info, file_id)
|
fs.os_fileinfo_id(file_info, file_id)
|
||||||
eq(file_info[0].stat.st_ino, file_id[0].inode)
|
eq(file_info[0].stat.st_ino, file_id[0].inode)
|
||||||
eq(file_info[0].stat.st_dev, file_id[0].device_id)
|
eq(file_info[0].stat.st_dev, file_id[0].device_id)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user