summaryrefslogtreecommitdiff
path: root/test/test_swift_find_project_root.vader
diff options
context:
space:
mode:
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(''))
+