Make yls tests work better locally

This commit is contained in:
w0rp
2025-03-18 11:38:42 +00:00
parent 47f1f49655
commit f3b6269388

View File

@@ -2,12 +2,18 @@ Before:
call ale#assert#SetUpLinterTest('yara', 'yls') call ale#assert#SetUpLinterTest('yara', 'yls')
After: After:
if isdirectory(g:dir . '/.git')
call delete(g:dir . '/.git', 'd')
endif
call ale#assert#TearDownLinterTest() call ale#assert#TearDownLinterTest()
Execute(The default executable path should be correct): Execute(The default executable path should be correct):
AssertLinter 'yls', ale#Escape('yls') . ' -v' AssertLinter 'yls', ale#Escape('yls') . ' -v'
Execute(The project root should be detected correctly): Execute(The project root should be detected correctly):
call ale#test#SetFilename('../test-files/yara/dummy.yar') if !isdirectory(g:dir . '/.git')
call mkdir(g:dir . '/.git')
endif
AssertLSPProject ale#path#Simplify(g:dir . '/../..') AssertLSPProject g:dir