summaryrefslogtreecommitdiff
path: root/test/test_swift_find_project_root.vader
diff options
context:
space:
mode:
authorDan Loman <daniel.h.loman@gmail.com>2019-04-08 08:25:30 -0700
committerw0rp <w0rp@users.noreply.github.com>2019-04-08 16:25:30 +0100
commit864d0861e47568ca5e69c9cba82af655730ae0d7 (patch)
tree002fd2d5c44212694786baa19a19c9392a79c2b4 /test/test_swift_find_project_root.vader
parent9a0ece1ecb4cddf9eebbc5bfa224764c4b5ad670 (diff)
downloadale-864d0861e47568ca5e69c9cba82af655730ae0d7.zip
[lsp] Add Swift / SourceKit-LSP support (#2420)
* [linter] Add LSP support for Swift via sourcekit-lsp
Diffstat (limited to 'test/test_swift_find_project_root.vader')
-rw-r--r--test/test_swift_find_project_root.vader18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_swift_find_project_root.vader b/test/test_swift_find_project_root.vader
new file mode 100644
index 00000000..7cb1cc29
--- /dev/null
+++ b/test/test_swift_find_project_root.vader
@@ -0,0 +1,18 @@
+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(''))
+