summaryrefslogtreecommitdiff
path: root/test/test_swift_find_project_root.vader
blob: 88a26021a597a4c38f513f18322c140de8434546 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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('test-files/swift/swift-package-project/src/folder/dummy.swift')
  AssertEqual
  \ ale#path#Simplify(g:dir . '/test-files/swift/swift-package-project'),
  \ ale#swift#FindProjectRoot(bufnr(''))

Execute(Detect no root in case of non-Package.swift project):
  call ale#test#SetFilename('test-files/swift/non-swift-package-project/src/folder/dummy.swift')
  AssertEqual
  \ '',
  \ ale#swift#FindProjectRoot(bufnr(''))