2017-09-09 16:30:20 -04:00
|
|
|
Before:
|
|
|
|
call ale#test#SetDirectory('/testplugin/test/fixers')
|
|
|
|
|
|
|
|
After:
|
|
|
|
unlet! b:ale_elm_format_executable
|
|
|
|
unlet! b:ale_elm_format_use_global
|
|
|
|
unlet! b:ale_elm_format_options
|
|
|
|
|
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
|
|
|
|
Execute(The elm-format command should have default params):
|
|
|
|
call ale#test#SetFilename('../elm-test-files/src/subdir/testfile.elm')
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
|
|
|
\ 'command':
|
2017-10-01 15:23:41 -04:00
|
|
|
\ ale#Escape(ale#path#Winify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format'))
|
2017-09-09 16:30:20 -04:00
|
|
|
\ . ' %t --yes',
|
|
|
|
\ },
|
|
|
|
\ ale#fixers#format#Fix(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The elm-format command should manage use_global = 1 param):
|
|
|
|
call ale#test#SetFilename('../elm-test-files/src/subdir/testfile.elm')
|
|
|
|
let b:ale_elm_format_use_global = 1
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
|
|
|
\ 'command':
|
|
|
|
\ ale#Escape('elm-format')
|
|
|
|
\ . ' %t --yes',
|
|
|
|
\ },
|
|
|
|
\ ale#fixers#format#Fix(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The elm-format command should manage executable param):
|
|
|
|
call ale#test#SetFilename('../elm-test-files/src/subdir/testfile.elm')
|
|
|
|
let b:ale_elm_format_use_global = 1
|
|
|
|
let b:ale_elm_format_executable = 'elmformat'
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
|
|
|
\ 'command':
|
|
|
|
\ ale#Escape('elmformat')
|
|
|
|
\ . ' %t --yes',
|
|
|
|
\ },
|
|
|
|
\ ale#fixers#format#Fix(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The elm-format command should manage empty options):
|
|
|
|
call ale#test#SetFilename('../elm-test-files/src/subdir/testfile.elm')
|
|
|
|
let b:ale_elm_format_options = ''
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
|
|
|
\ 'command':
|
2017-10-01 15:23:41 -04:00
|
|
|
\ ale#Escape(ale#path#Winify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format'))
|
2017-09-09 16:30:20 -04:00
|
|
|
\ . ' %t',
|
|
|
|
\ },
|
|
|
|
\ ale#fixers#format#Fix(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The elm-format command should manage custom options):
|
|
|
|
call ale#test#SetFilename('../elm-test-files/src/subdir/testfile.elm')
|
|
|
|
let b:ale_elm_format_options = '--param1 --param2'
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
|
|
|
\ 'command':
|
2017-10-01 15:23:41 -04:00
|
|
|
\ ale#Escape(ale#path#Winify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format'))
|
2017-09-09 16:30:20 -04:00
|
|
|
\ . ' %t --param1 --param2',
|
|
|
|
\ },
|
|
|
|
\ ale#fixers#format#Fix(bufnr(''))
|