mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 09:56:31 +00:00
fileid: rename os_file_id_equal_file_info
This commit is contained in:
@@ -1181,7 +1181,7 @@ static int cs_insert_filelist(char *fname, char *ppath, char *flags,
|
||||
i = -1; /* can be set to the index of an empty item in csinfo */
|
||||
for (j = 0; j < csinfo_size; j++) {
|
||||
if (csinfo[j].fname != NULL
|
||||
&& os_fileid_equal_file_info(&(csinfo[j].file_id), file_info)) {
|
||||
&& os_fileid_equal_fileinfo(&(csinfo[j].file_id), file_info)) {
|
||||
if (p_csverbose)
|
||||
(void)EMSG(_("E568: duplicate cscope database not added"));
|
||||
return -1;
|
||||
|
@@ -453,7 +453,7 @@ bool os_fileid_equal(const FileID *file_id_1, const FileID *file_id_2)
|
||||
/// @param file_id Pointer to a `FileID`
|
||||
/// @param file_info Pointer to a `FileInfo`
|
||||
/// @return `true` if the `FileID` and the `FileInfo` represent te same file.
|
||||
bool os_fileid_equal_file_info(const FileID *file_id,
|
||||
bool os_fileid_equal_fileinfo(const FileID *file_id,
|
||||
const FileInfo *file_info)
|
||||
{
|
||||
return file_id->inode == file_info->stat.st_ino
|
||||
|
@@ -680,14 +680,14 @@ describe('fs function', function()
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('os_fileid_equal_file_info', function()
|
||||
describe('os_fileid_equal_fileinfo', function()
|
||||
it('returns true if file_id and file_info represent the same file', 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_fileid(path, file_id)))
|
||||
assert.is_true((fs.os_fileinfo(path, file_info)))
|
||||
assert.is_true((fs.os_fileid_equal_file_info(file_id, file_info)))
|
||||
assert.is_true((fs.os_fileid_equal_fileinfo(file_id, file_info)))
|
||||
end)
|
||||
|
||||
it('returns false if file_id and file_info represent different files', function()
|
||||
@@ -697,7 +697,7 @@ describe('fs function', function()
|
||||
local path_2 = 'unit-test-directory/test_2.file'
|
||||
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_fileid_equal_file_info(file_id, file_info)))
|
||||
assert.is_false((fs.os_fileid_equal_fileinfo(file_id, file_info)))
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user