ale/test/test_swift_find_project_root.vader
Dan Loman 864d0861e4 [lsp] Add Swift / SourceKit-LSP support (#2420)
* [linter] Add LSP support for Swift via sourcekit-lsp
2019-04-08 16:25:30 +01:00

19 lines
615 B
Plaintext

Before:
call ale#test#SetDirectory('/testplugin/test')
After:
call ale#test#RestoreDirectory()
Execute(Detect root of Swift project with Package.swift correctly):
call ale#test#SetFilename('swift-test-files/swift-package-project/src/folder/dummy.swift')
AssertEqual
\ ale#path#Simplify(g:dir . '/swift-test-files/swift-package-project'),
\ ale#swift#FindProjectRoot(bufnr(''))
Execute(Detect no root in case of non-Package.swift project):
call ale#test#SetFilename('swift-test-files/non-swift-package-project/src/folder/dummy.swift')
AssertEqual
\ '',
\ ale#swift#FindProjectRoot(bufnr(''))