diff options
author | w0rp <devw0rp@gmail.com> | 2021-03-20 22:11:22 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2021-03-20 22:11:42 +0000 |
commit | b1d833417bcb57e265e0d01df07b28f463529d4b (patch) | |
tree | 11421aeca89127b0cc9417f8ff4cb0d725199f49 /test/command_callback/test_swiftlint_command_callback.vader | |
parent | 3838ae118d8f05fa1b1be7952a1c8aa3055d6728 (diff) | |
download | ale-b1d833417bcb57e265e0d01df07b28f463529d4b.zip |
#3633 - Put all dummy test files in test/test-files
Diffstat (limited to 'test/command_callback/test_swiftlint_command_callback.vader')
-rw-r--r-- | test/command_callback/test_swiftlint_command_callback.vader | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/command_callback/test_swiftlint_command_callback.vader b/test/command_callback/test_swiftlint_command_callback.vader new file mode 100644 index 00000000..d2442b0a --- /dev/null +++ b/test/command_callback/test_swiftlint_command_callback.vader @@ -0,0 +1,43 @@ +Before: + call ale#assert#SetUpLinterTest('swift', 'swiftlint') + +After: + call ale#assert#TearDownLinterTest() + +Execute(Global installation should be the default executable): + call ale#test#SetFilename('../test-files/swiftlint/global/testfile.swift') + + AssertEqual + \ 'swiftlint', + \ ale_linters#swift#swiftlint#GetExecutable(bufnr('')) + +Execute(React Native apps using CocoaPods should take precedence over the default executable): + call ale#test#SetFilename('../test-files/swiftlint/react-native/testfile.swift') + + AssertEqual + \ tolower(ale#test#GetFilename('../test-files/swiftlint/react-native/ios/Pods/SwiftLint/swiftlint')), + \ tolower(ale_linters#swift#swiftlint#GetExecutable(bufnr(''))) + +Execute(CocoaPods installation should take precedence over the default executable): + call ale#test#SetFilename('../test-files/swiftlint/cocoapods/testfile.swift') + + AssertEqual + \ tolower(ale#test#GetFilename('../test-files/swiftlint/cocoapods/Pods/SwiftLint/swiftlint')), + \ tolower(ale_linters#swift#swiftlint#GetExecutable(bufnr(''))) + +Execute(Top level CocoaPods installation should take precedence over React Native installation): + call ale#test#SetFilename('../test-files/swiftlint/cocoapods-and-react-native/testfile.swift') + + AssertEqual + \ tolower(ale#test#GetFilename('../test-files/swiftlint/cocoapods-and-react-native/Pods/SwiftLint/swiftlint')), + \ tolower(ale_linters#swift#swiftlint#GetExecutable(bufnr(''))) + +Execute(use-global should override other versions): + let g:ale_swift_swiftlint_use_global = 1 + let g:ale_swift_swiftlint_executable = 'swiftlint_d' + + call ale#test#SetFilename('../test-files/swiftlint/cocoapods-and-react-native/testfile.swift') + + AssertEqual + \ 'swiftlint_d', + \ ale_linters#swift#swiftlint#GetExecutable(bufnr('')) |