mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #1833 from aktau/formatc-fix-gcc-on-osx
test: Correct lfs.attributes() call, and allow unit tests to run with gcc on OSX
This commit is contained in:
commit
bff48b23d7
@ -149,8 +149,7 @@ local C_keywords = set {
|
|||||||
-- };
|
-- };
|
||||||
--
|
--
|
||||||
-- would become:
|
-- would become:
|
||||||
-- struct mystruct
|
-- struct mystruct { int a; int b; };
|
||||||
-- { int a; int b; };
|
|
||||||
--
|
--
|
||||||
-- The first one will have a lot of false positives (the line '{' for
|
-- The first one will have a lot of false positives (the line '{' for
|
||||||
-- example), the second one is more unique.
|
-- example), the second one is more unique.
|
||||||
@ -179,7 +178,8 @@ local function formatc(str)
|
|||||||
-- static and/or inline usually indicate an inline header function,
|
-- static and/or inline usually indicate an inline header function,
|
||||||
-- which has no trailing ';', so we have to add a newline after the
|
-- which has no trailing ';', so we have to add a newline after the
|
||||||
-- '}' ourselves.
|
-- '}' ourselves.
|
||||||
if token[1] == 'static' or token[1] == 'inline' then
|
local tok = token[1]
|
||||||
|
if tok == 'static' or tok == 'inline' or tok == '__inline' then
|
||||||
end_at_brace = true
|
end_at_brace = true
|
||||||
end
|
end
|
||||||
elseif typ == 'preprocessor' then
|
elseif typ == 'preprocessor' then
|
||||||
|
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user