This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/test/command_callback/test_swift_swiftformat_command_callbacks.vader

26 lines
969 B
Text
Raw Normal View History

2020-02-11 14:57:58 +00:00
Before:
call ale#assert#SetUpLinterTest('swift', 'swiftformat')
After:
call ale#assert#TearDownLinterTest()
Execute(Should use default command when not in a swift package):
call ale#test#SetFilename('../swift-test-files/non-swift-package-project/src/folder/dummy.swift')
AssertLinter 'swift-format',
\ ale#Escape('swift-format') . ' --mode lint %t'
Execute(Should use swift run when in a swift package):
call ale#test#SetFilename('../swift-test-files/swift-package-project/src/folder/dummy.swift')
AssertLinter 'swift',
\ ale#Escape('swift') . ' run swift-format --mode lint %t'
Execute(Should let users configure a global executable and override local paths):
call ale#test#SetFilename('../swift-test-files/swift-package-project/src/folder/dummy.swift')
let g:ale_swift_swiftformat_executable = '/path/to/custom/swift-format'
AssertLinter '/path/to/custom/swift-format',
\ ale#Escape('/path/to/custom/swift-format') . ' --mode lint %t'