Fix the mscs tests on Windows, and use the improved Simplify for all tests instead.

This commit is contained in:
w0rp 2017-12-19 18:23:09 +00:00
parent 73f61514c9
commit 1568bf8128
68 changed files with 224 additions and 241 deletions

View file

@ -17,23 +17,6 @@ function! ale#path#Simplify(path) abort
return substitute(simplify(l:win_path), '^\\\+', '\', 'g') " no-custom-checks return substitute(simplify(l:win_path), '^\\\+', '\', 'g') " no-custom-checks
endfunction endfunction
" This function is mainly used for testing.
"
" If an additional 'add_drive' argument is given, the current drive letter
" will be prefixed to any absolute paths on Windows.
function! ale#path#Winify(path, ...) abort
let l:new_path = ale#path#Simplify(a:path)
if has('win32')
" Add a drive letter to \foo\bar paths, if needed.
if a:0 && a:1 is# 'add_drive' && l:new_path[:0] is# '\'
let l:new_path = fnamemodify('.', ':p')[:1] . l:new_path
endif
endif
return l:new_path
endfunction
" Given a buffer and a filename, find the nearest file by searching upwards " Given a buffer and a filename, find the nearest file by searching upwards
" through the paths relative to the given buffer. " through the paths relative to the given buffer.
function! ale#path#FindNearestFile(buffer, filename) abort function! ale#path#FindNearestFile(buffer, filename) abort

View file

@ -50,5 +50,5 @@ function! ale#test#SetFilename(path) abort
\ ? a:path \ ? a:path
\ : l:dir . '/' . a:path \ : l:dir . '/' . a:path
silent! noautocmd execute 'file ' . fnameescape(ale#path#Winify(l:full_path)) silent! noautocmd execute 'file ' . fnameescape(ale#path#Simplify(l:full_path))
endfunction endfunction

View file

@ -25,7 +25,7 @@ Execute(The brakeman command callback should find a valid Rails app root):
AssertEqual AssertEqual
\ 'brakeman -f json -q -p ' \ 'brakeman -f json -q -p '
\ . ale#Escape(ale#path#Winify(g:dir . '/../ruby_fixtures/valid_rails_app')), \ . ale#Escape(ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app')),
\ ale_linters#ruby#brakeman#GetCommand(bufnr('')) \ ale_linters#ruby#brakeman#GetCommand(bufnr(''))
Execute(The brakeman command callback should include configured options): Execute(The brakeman command callback should include configured options):
@ -35,5 +35,5 @@ Execute(The brakeman command callback should include configured options):
AssertEqual AssertEqual
\ 'brakeman -f json -q --combobulate -p ' \ 'brakeman -f json -q --combobulate -p '
\ . ale#Escape(ale#path#Winify(g:dir . '/../ruby_fixtures/valid_rails_app')), \ . ale#Escape(ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app')),
\ ale_linters#ruby#brakeman#GetCommand(bufnr('')) \ ale_linters#ruby#brakeman#GetCommand(bufnr(''))

View file

@ -43,7 +43,7 @@ Execute(cppcheck for C++ should detect compile_commands.json files):
call ale#test#SetFilename('cppcheck_paths/one/foo.cpp') call ale#test#SetFilename('cppcheck_paths/one/foo.cpp')
AssertEqual AssertEqual
\ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/cppcheck_paths/one')) . ' && ' \ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/cppcheck_paths/one')) . ' && '
\ . ale#Escape('cppcheck') \ . ale#Escape('cppcheck')
\ . ' -q --language=c --project=compile_commands.json --enable=style %t', \ . ' -q --language=c --project=compile_commands.json --enable=style %t',
\ ale_linters#c#cppcheck#GetCommand(bufnr('')) \ ale_linters#c#cppcheck#GetCommand(bufnr(''))

View file

@ -43,7 +43,7 @@ Execute(cppcheck for C++ should detect compile_commands.json files):
call ale#test#SetFilename('cppcheck_paths/one/foo.cpp') call ale#test#SetFilename('cppcheck_paths/one/foo.cpp')
AssertEqual AssertEqual
\ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/cppcheck_paths/one')) . ' && ' \ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/cppcheck_paths/one')) . ' && '
\ . ale#Escape('cppcheck') \ . ale#Escape('cppcheck')
\ . ' -q --language=c++ --project=compile_commands.json --enable=style %t', \ . ' -q --language=c++ --project=compile_commands.json --enable=style %t',
\ ale_linters#cpp#cppcheck#GetCommand(bufnr('')) \ ale_linters#cpp#cppcheck#GetCommand(bufnr(''))

View file

@ -35,6 +35,6 @@ Execute(The .packages file should be set if detected):
AssertEqual AssertEqual
\ ale#Escape('dartanalyzer') \ ale#Escape('dartanalyzer')
\ . ' --packages ' . ale#Escape(ale#path#Winify(g:dir . '/dart_paths/.packages')) \ . ' --packages ' . ale#Escape(ale#path#Simplify(g:dir . '/dart_paths/.packages'))
\ . ' %s', \ . ' %s',
\ ale_linters#dart#dartanalyzer#GetCommand(bufnr('')) \ ale_linters#dart#dartanalyzer#GetCommand(bufnr(''))

View file

@ -76,7 +76,7 @@ Execute(You should be able to set a custom executable and it should be escaped):
Execute(The flake8 callbacks should detect virtualenv directories): Execute(The flake8 callbacks should detect virtualenv directories):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
let b:executable = ale#path#Winify( let b:executable = ale#path#Simplify(
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/flake8' \ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/flake8'
\) \)
@ -95,35 +95,35 @@ Execute(The FindProjectRoot should detect the project root directory for namespa
silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_manifest/namespace/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_manifest/namespace/foo/bar.py')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/python_paths/namespace_package_manifest'), \ ale#path#Simplify(g:dir . '/python_paths/namespace_package_manifest'),
\ ale#python#FindProjectRoot(bufnr('')) \ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for namespace package via setup.cf): Execute(The FindProjectRoot should detect the project root directory for namespace package via setup.cf):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_setup/namespace/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_setup/namespace/foo/bar.py')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/python_paths/namespace_package_setup'), \ ale#path#Simplify(g:dir . '/python_paths/namespace_package_setup'),
\ ale#python#FindProjectRoot(bufnr('')) \ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for namespace package via pytest.ini): Execute(The FindProjectRoot should detect the project root directory for namespace package via pytest.ini):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_pytest/namespace/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_pytest/namespace/foo/bar.py')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/python_paths/namespace_package_pytest'), \ ale#path#Simplify(g:dir . '/python_paths/namespace_package_pytest'),
\ ale#python#FindProjectRoot(bufnr('')) \ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for namespace package via tox.ini): Execute(The FindProjectRoot should detect the project root directory for namespace package via tox.ini):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_tox/namespace/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_tox/namespace/foo/bar.py')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/python_paths/namespace_package_tox'), \ ale#path#Simplify(g:dir . '/python_paths/namespace_package_tox'),
\ ale#python#FindProjectRoot(bufnr('')) \ ale#python#FindProjectRoot(bufnr(''))
Execute(The FindProjectRoot should detect the project root directory for non-namespace package): Execute(The FindProjectRoot should detect the project root directory for non-namespace package):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/no_virtualenv/subdir/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/no_virtualenv/subdir/foo/bar.py')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/python_paths/no_virtualenv/subdir'), \ ale#path#Simplify(g:dir . '/python_paths/no_virtualenv/subdir'),
\ ale#python#FindProjectRoot(bufnr('')) \ ale#python#FindProjectRoot(bufnr(''))
" Some users currently run flake8 this way, so we should support it. " Some users currently run flake8 this way, so we should support it.

View file

@ -18,7 +18,7 @@ Execute(The default command should be correct):
Execute(The command should have the .rubocop.yml prepended as an env var if one exists): Execute(The command should have the .rubocop.yml prepended as an env var if one exists):
call ale#test#SetFilename('../hamllint-test-files/rubocop-yml/subdir/file.haml') call ale#test#SetFilename('../hamllint-test-files/rubocop-yml/subdir/file.haml')
let b:conf = ale#path#Winify(g:dir . '/../hamllint-test-files/rubocop-yml/.rubocop.yml') let b:conf = ale#path#Simplify(g:dir . '/../hamllint-test-files/rubocop-yml/.rubocop.yml')
if has('win32') if has('win32')
" Windows uses 'set var=... && command' " Windows uses 'set var=... && command'
@ -38,7 +38,7 @@ Execute(The command should have the .rubocop.yml prepended as an env var if one
Execute(The command should have the nearest .haml-lint.yml set as --config if it exists): Execute(The command should have the nearest .haml-lint.yml set as --config if it exists):
call ale#test#SetFilename('../hamllint-test-files/haml-lint-yml/subdir/file.haml') call ale#test#SetFilename('../hamllint-test-files/haml-lint-yml/subdir/file.haml')
let b:conf = ale#path#Winify(g:dir . '/../hamllint-test-files/haml-lint-yml/.haml-lint.yml') let b:conf = ale#path#Simplify(g:dir . '/../hamllint-test-files/haml-lint-yml/.haml-lint.yml')
AssertEqual AssertEqual
\ 'haml-lint --config ' \ 'haml-lint --config '
@ -48,8 +48,8 @@ Execute(The command should have the nearest .haml-lint.yml set as --config if it
Execute(The command should include a .rubocop.yml and a .haml-lint if both are found): Execute(The command should include a .rubocop.yml and a .haml-lint if both are found):
call ale#test#SetFilename('../hamllint-test-files/haml-lint-and-rubocop/subdir/file.haml') call ale#test#SetFilename('../hamllint-test-files/haml-lint-and-rubocop/subdir/file.haml')
let b:conf_hamllint = ale#path#Winify(g:dir . '/../hamllint-test-files/haml-lint-and-rubocop/.haml-lint.yml') let b:conf_hamllint = ale#path#Simplify(g:dir . '/../hamllint-test-files/haml-lint-and-rubocop/.haml-lint.yml')
let b:conf_rubocop = ale#path#Winify(g:dir . '/../hamllint-test-files/haml-lint-and-rubocop/.rubocop.yml') let b:conf_rubocop = ale#path#Simplify(g:dir . '/../hamllint-test-files/haml-lint-and-rubocop/.rubocop.yml')
if has('win32') if has('win32')
" Windows uses 'set var=... && command' " Windows uses 'set var=... && command'

View file

@ -122,7 +122,7 @@ Execute(The javac callback should detect source directories):
AssertEqual AssertEqual
\ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint' \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint'
\ . ' -sourcepath ' . ale#Escape( \ . ' -sourcepath ' . ale#Escape(
\ ale#path#Winify(g:dir . '/java_paths/src/main/java/') \ ale#path#Simplify(g:dir . '/java_paths/src/main/java/')
\ ) \ )
\ . ' -d TEMP %t', \ . ' -d TEMP %t',
\ GetCommand([]) \ GetCommand([])
@ -136,7 +136,7 @@ Execute(The javac callback should combine detected source directories and classp
\ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint' \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint'
\ . ' -cp ' . ale#Escape(join(['/foo/bar.jar', '/xyz/abc.jar'], g:cp_sep)) \ . ' -cp ' . ale#Escape(join(['/foo/bar.jar', '/xyz/abc.jar'], g:cp_sep))
\ . ' -sourcepath ' . ale#Escape( \ . ' -sourcepath ' . ale#Escape(
\ ale#path#Winify(g:dir . '/java_paths/src/main/java/') \ ale#path#Simplify(g:dir . '/java_paths/src/main/java/')
\ ) \ )
\ . ' -d TEMP %t', \ . ' -d TEMP %t',
\ GetCommand([ \ GetCommand([
@ -166,8 +166,8 @@ Execute(The javac callback should include src/test/java for test paths):
AssertEqual AssertEqual
\ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint' \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint'
\ . ' -sourcepath ' . ale#Escape(join([ \ . ' -sourcepath ' . ale#Escape(join([
\ ale#path#Winify(g:dir . '/java_paths/src/main/java/'), \ ale#path#Simplify(g:dir . '/java_paths/src/main/java/'),
\ ale#path#Winify(g:dir . '/java_paths/src/test/java/'), \ ale#path#Simplify(g:dir . '/java_paths/src/test/java/'),
\ ], g:cp_sep)) \ ], g:cp_sep))
\ . ' -d TEMP %t', \ . ' -d TEMP %t',
\ GetCommand([]) \ GetCommand([])
@ -180,8 +180,8 @@ Execute(The javac callback should include src/main/jaxb when available):
AssertEqual AssertEqual
\ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint' \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint'
\ . ' -sourcepath ' . ale#Escape(join([ \ . ' -sourcepath ' . ale#Escape(join([
\ ale#path#Winify(g:dir . '/java_paths_with_jaxb/src/main/java/'), \ ale#path#Simplify(g:dir . '/java_paths_with_jaxb/src/main/java/'),
\ ale#path#Winify(g:dir . '/java_paths_with_jaxb/src/main/jaxb/'), \ ale#path#Simplify(g:dir . '/java_paths_with_jaxb/src/main/jaxb/'),
\ ], g:cp_sep)) \ ], g:cp_sep))
\ . ' -d TEMP %t', \ . ' -d TEMP %t',
\ GetCommand([]) \ GetCommand([])

View file

@ -30,7 +30,7 @@ After:
Execute(node_modules directories should be discovered): Execute(node_modules directories should be discovered):
call ale#test#SetFilename('stylelint_paths/nested/testfile.less') call ale#test#SetFilename('stylelint_paths/nested/testfile.less')
let b:executable = ale#path#Winify( let b:executable = ale#path#Simplify(
\ g:dir \ g:dir
\ . '/stylelint_paths/node_modules/.bin/stylelint' \ . '/stylelint_paths/node_modules/.bin/stylelint'
\) \)

View file

@ -30,7 +30,7 @@ After:
Execute(node_modules directories should be discovered): Execute(node_modules directories should be discovered):
call ale#test#SetFilename('lessc_paths/nested/testfile.less') call ale#test#SetFilename('lessc_paths/nested/testfile.less')
let b:executable = ale#path#Winify( let b:executable = ale#path#Simplify(
\ g:dir \ g:dir
\ . '/lessc_paths/node_modules/.bin/lessc' \ . '/lessc_paths/node_modules/.bin/lessc'
\) \)
@ -43,7 +43,7 @@ Execute(node_modules directories should be discovered):
\ ale#Escape(b:executable) \ ale#Escape(b:executable)
\ . ' --no-color --lint' \ . ' --no-color --lint'
\ . ' --include-path=' \ . ' --include-path='
\ . ale#Escape(ale#path#Winify(g:dir . '/lessc_paths/nested')) \ . ale#Escape(ale#path#Simplify(g:dir . '/lessc_paths/nested'))
\ . ' -', \ . ' -',
\ ale_linters#less#lessc#GetCommand(bufnr('')) \ ale_linters#less#lessc#GetCommand(bufnr(''))
@ -61,7 +61,7 @@ Execute(The global override should work):
\ ale#Escape('foobar') \ ale#Escape('foobar')
\ . ' --no-color --lint' \ . ' --no-color --lint'
\ . ' --include-path=' \ . ' --include-path='
\ . ale#Escape(ale#path#Winify(g:dir . '/lessc_paths/nested')) \ . ale#Escape(ale#path#Simplify(g:dir . '/lessc_paths/nested'))
\ . ' -', \ . ' -',
\ ale_linters#less#lessc#GetCommand(bufnr('')) \ ale_linters#less#lessc#GetCommand(bufnr(''))
@ -76,7 +76,7 @@ Execute(Extra options should be configurable):
\ ale#Escape('lessc') \ ale#Escape('lessc')
\ . ' --no-color --lint' \ . ' --no-color --lint'
\ . ' --include-path=' \ . ' --include-path='
\ . ale#Escape(ale#path#Winify(g:dir)) \ . ale#Escape(ale#path#Simplify(g:dir))
\ . ' --whatever' \ . ' --whatever'
\ . ' -', \ . ' -',
\ ale_linters#less#lessc#GetCommand(bufnr('')) \ ale_linters#less#lessc#GetCommand(bufnr(''))

View file

@ -61,7 +61,7 @@ Execute(The mypy command should switch directories to the detected project root)
\ 'mypy', \ 'mypy',
\ ale_linters#python#mypy#GetExecutable(bufnr('')) \ ale_linters#python#mypy#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/python_paths/no_virtualenv/subdir')) \ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/no_virtualenv/subdir'))
\ . ' && ' . ale#Escape('mypy') \ . ' && ' . ale#Escape('mypy')
\ . ' --show-column-numbers ' \ . ' --show-column-numbers '
\ . '--shadow-file %s %t %s', \ . '--shadow-file %s %t %s',
@ -70,13 +70,13 @@ Execute(The mypy command should switch directories to the detected project root)
Execute(The mypy callbacks should detect virtualenv directories and switch to the project root): Execute(The mypy callbacks should detect virtualenv directories and switch to the project root):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
let b:executable = ale#path#Winify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/mypy') let b:executable = ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/mypy')
AssertEqual AssertEqual
\ b:executable, \ b:executable,
\ ale_linters#python#mypy#GetExecutable(bufnr('')) \ ale_linters#python#mypy#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/subdir')) \ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir'))
\ . ' && ' . ale#Escape(b:executable) \ . ' && ' . ale#Escape(b:executable)
\ . ' --show-column-numbers ' \ . ' --show-column-numbers '
\ . '--shadow-file %s %t %s', \ . '--shadow-file %s %t %s',
@ -90,7 +90,7 @@ Execute(You should able able to use the global mypy instead):
\ 'mypy', \ 'mypy',
\ ale_linters#python#mypy#GetExecutable(bufnr('')) \ ale_linters#python#mypy#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/subdir')) \ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir'))
\ . ' && ' . ale#Escape('mypy') \ . ' && ' . ale#Escape('mypy')
\ . ' --show-column-numbers ' \ . ' --show-column-numbers '
\ . '--shadow-file %s %t %s', \ . '--shadow-file %s %t %s',

View file

@ -32,14 +32,14 @@ Execute(The project root should be detected correctly):
call ale#test#SetFilename('ols_paths/file.ml') call ale#test#SetFilename('ols_paths/file.ml')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/ols_paths'), \ ale#path#Simplify(g:dir . '/ols_paths'),
\ ale#handlers#ols#GetProjectRoot(bufnr('')) \ ale#handlers#ols#GetProjectRoot(bufnr(''))
Execute(The local executable should be used when available): Execute(The local executable should be used when available):
call ale#test#SetFilename('ols_paths/file.ml') call ale#test#SetFilename('ols_paths/file.ml')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server'), \ ale#path#Simplify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server'),
\ ale#handlers#ols#GetExecutable(bufnr('')) \ ale#handlers#ols#GetExecutable(bufnr(''))
Execute(The gloabl executable should always be used when use_global is set): Execute(The gloabl executable should always be used when use_global is set):

View file

@ -43,7 +43,7 @@ Execute(The command should be correct with g:ale_perl_perlcritic_showrules on):
Execute(The command search for the profile file when set): Execute(The command search for the profile file when set):
let b:ale_perl_perlcritic_profile = 'README.md' let b:ale_perl_perlcritic_profile = 'README.md'
let b:readme_path = ale#path#Winify(expand('%:p:h:h:h') . '/README.md') let b:readme_path = ale#path#Simplify(expand('%:p:h:h:h') . '/README.md')
AssertEqual AssertEqual
\ ale#Escape('perlcritic') . ' --verbose ''%l:%c %m\n'' --nocolor' \ ale#Escape('perlcritic') . ' --verbose ''%l:%c %m\n'' --nocolor'

View file

@ -33,10 +33,10 @@ Execute(Vendor executables should be detected):
call ale#test#SetFilename('php-langserver-project/test.php') call ale#test#SetFilename('php-langserver-project/test.php')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/php-langserver-project/vendor/bin/php-language-server.php'), \ ale#path#Simplify(g:dir . '/php-langserver-project/vendor/bin/php-language-server.php'),
\ ale_linters#php#langserver#GetExecutable(bufnr('')) \ ale_linters#php#langserver#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ 'php ' . ale#Escape(ale#path#Winify( \ 'php ' . ale#Escape(ale#path#Simplify(
\ g:dir \ g:dir
\ . '/php-langserver-project/vendor/bin/php-language-server.php' \ . '/php-langserver-project/vendor/bin/php-language-server.php'
\ )), \ )),

View file

@ -21,12 +21,12 @@ Execute(puglint should detect local executables and package.json):
call ale#test#SetFilename('puglint_project/test.pug') call ale#test#SetFilename('puglint_project/test.pug')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'), \ ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'),
\ ale_linters#pug#puglint#GetExecutable(bufnr('')) \ ale_linters#pug#puglint#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint')) \ ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/package.json')) \ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/package.json'))
\ . ' -r inline %t', \ . ' -r inline %t',
\ ale_linters#pug#puglint#GetCommand(bufnr('')) \ ale_linters#pug#puglint#GetCommand(bufnr(''))
@ -39,7 +39,7 @@ Execute(puglint should use global executables if configured):
AssertEqual AssertEqual
\ ale#Escape('pug-lint') \ ale#Escape('pug-lint')
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/package.json')) \ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/package.json'))
\ . ' -r inline %t', \ . ' -r inline %t',
\ ale_linters#pug#puglint#GetCommand(bufnr('')) \ ale_linters#pug#puglint#GetCommand(bufnr(''))
@ -47,8 +47,8 @@ Execute(puglint should detect .pug-lintrc):
call ale#test#SetFilename('puglint_project/puglint_rc_dir/subdir/test.pug') call ale#test#SetFilename('puglint_project/puglint_rc_dir/subdir/test.pug')
AssertEqual AssertEqual
\ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint')) \ ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/puglint_rc_dir/.pug-lintrc')) \ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/puglint_rc_dir/.pug-lintrc'))
\ . ' -r inline %t', \ . ' -r inline %t',
\ ale_linters#pug#puglint#GetCommand(bufnr('')) \ ale_linters#pug#puglint#GetCommand(bufnr(''))
@ -56,8 +56,8 @@ Execute(puglint should detect .pug-lintrc.js):
call ale#test#SetFilename('puglint_project/puglint_rc_js_dir/subdir/test.pug') call ale#test#SetFilename('puglint_project/puglint_rc_js_dir/subdir/test.pug')
AssertEqual AssertEqual
\ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint')) \ ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/puglint_rc_js_dir/.pug-lintrc.js')) \ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/puglint_rc_js_dir/.pug-lintrc.js'))
\ . ' -r inline %t', \ . ' -r inline %t',
\ ale_linters#pug#puglint#GetCommand(bufnr('')) \ ale_linters#pug#puglint#GetCommand(bufnr(''))
@ -65,7 +65,7 @@ Execute(puglint should detect .pug-lintrc.json):
call ale#test#SetFilename('puglint_project/puglint_rc_json_dir/subdir/test.pug') call ale#test#SetFilename('puglint_project/puglint_rc_json_dir/subdir/test.pug')
AssertEqual AssertEqual
\ ale#Escape(ale#path#Winify(g:dir . '/puglint_project/node_modules/.bin/pug-lint')) \ ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/puglint_project/puglint_rc_json_dir/.pug-lintrc.json')) \ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/puglint_rc_json_dir/.pug-lintrc.json'))
\ . ' -r inline %t', \ . ' -r inline %t',
\ ale_linters#pug#puglint#GetCommand(bufnr('')) \ ale_linters#pug#puglint#GetCommand(bufnr(''))

View file

@ -33,7 +33,7 @@ Execute(The pyflakes executable should be configurable):
Execute(The pyflakes executable should be run from the virtualenv path): Execute(The pyflakes executable should be run from the virtualenv path):
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py') call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
let b:executable = ale#path#Winify( let b:executable = ale#path#Simplify(
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/pyflakes' \ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/pyflakes'
\) \)

View file

@ -61,7 +61,7 @@ Execute(The pylint callbacks shouldn't detect virtualenv directories where they
Execute(The pylint callbacks should detect virtualenv directories): Execute(The pylint callbacks should detect virtualenv directories):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
let b:executable = ale#path#Winify( let b:executable = ale#path#Simplify(
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/pylint' \ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/pylint'
\) \)

View file

@ -33,7 +33,7 @@ Execute(The pyls executable should be configurable):
Execute(The pyls executable should be run from the virtualenv path): Execute(The pyls executable should be run from the virtualenv path):
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py') call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
let b:executable = ale#path#Winify( let b:executable = ale#path#Simplify(
\ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/pyls' \ g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/pyls'
\) \)

View file

@ -9,7 +9,7 @@ Before:
let b:args = '--silent -f json' let b:args = '--silent -f json'
\ . ' --output-file ' . (has('win32') ? '%t' : '/dev/stdout') \ . ' --output-file ' . (has('win32') ? '%t' : '/dev/stdout')
let b:app_path = ale#path#Winify(g:dir . '/../ruby_fixtures/valid_rails_app') let b:app_path = ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app')
let b:suffix = has('win32') ? '; type %t' : '' let b:suffix = has('win32') ? '; type %t' : ''
After: After:

View file

@ -32,14 +32,14 @@ Execute(The project root should be detected correctly):
call ale#test#SetFilename('ols_paths/file.re') call ale#test#SetFilename('ols_paths/file.re')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/ols_paths'), \ ale#path#Simplify(g:dir . '/ols_paths'),
\ ale#handlers#ols#GetProjectRoot(bufnr('')) \ ale#handlers#ols#GetProjectRoot(bufnr(''))
Execute(The local executable should be used when available): Execute(The local executable should be used when available):
call ale#test#SetFilename('ols_paths/file.re') call ale#test#SetFilename('ols_paths/file.re')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server'), \ ale#path#Simplify(g:dir . '/ols_paths/node_modules/.bin/ocaml-language-server'),
\ ale#handlers#ols#GetExecutable(bufnr('')) \ ale#handlers#ols#GetExecutable(bufnr(''))
Execute(The gloabl executable should always be used when use_global is set): Execute(The gloabl executable should always be used when use_global is set):

View file

@ -17,7 +17,7 @@ Execute(Executable should default to rubocop):
AssertEqual AssertEqual
\ ale#Escape('rubocop') \ ale#Escape('rubocop')
\ . ' --format json --force-exclusion --stdin ' \ . ' --format json --force-exclusion --stdin '
\ . ale#Escape(ale#path#Winify(g:dir . '/dummy.rb')), \ . ale#Escape(ale#path#Simplify(g:dir . '/dummy.rb')),
\ ale_linters#ruby#rubocop#GetCommand(bufnr('')) \ ale_linters#ruby#rubocop#GetCommand(bufnr(''))
Execute(Should be able to set a custom executable): Execute(Should be able to set a custom executable):
@ -26,7 +26,7 @@ Execute(Should be able to set a custom executable):
AssertEqual AssertEqual
\ ale#Escape('bin/rubocop') \ ale#Escape('bin/rubocop')
\ . ' --format json --force-exclusion --stdin ' \ . ' --format json --force-exclusion --stdin '
\ . ale#Escape(ale#path#Winify(g:dir . '/dummy.rb')), \ . ale#Escape(ale#path#Simplify(g:dir . '/dummy.rb')),
\ ale_linters#ruby#rubocop#GetCommand(bufnr('')) \ ale_linters#ruby#rubocop#GetCommand(bufnr(''))
Execute(Setting bundle appends 'exec rubocop'): Execute(Setting bundle appends 'exec rubocop'):
@ -35,5 +35,5 @@ Execute(Setting bundle appends 'exec rubocop'):
AssertEqual AssertEqual
\ ale#Escape('path to/bundle') . ' exec rubocop' \ ale#Escape('path to/bundle') . ' exec rubocop'
\ . ' --format json --force-exclusion --stdin ' \ . ' --format json --force-exclusion --stdin '
\ . ale#Escape(ale#path#Winify(g:dir . '/dummy.rb')), \ . ale#Escape(ale#path#Simplify(g:dir . '/dummy.rb')),
\ ale_linters#ruby#rubocop#GetCommand(bufnr('')) \ ale_linters#ruby#rubocop#GetCommand(bufnr(''))

View file

@ -37,5 +37,5 @@ Execute(The project root should be detected correctly):
call ale#test#SetFilename('rust-rls-project/test.rs') call ale#test#SetFilename('rust-rls-project/test.rs')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/rust-rls-project'), \ ale#path#Simplify(g:dir . '/rust-rls-project'),
\ ale_linters#rust#rls#GetProjectRoot(bufnr('')) \ ale_linters#rust#rls#GetProjectRoot(bufnr(''))

View file

@ -12,7 +12,7 @@ Before:
call ale#test#SetDirectory('/testplugin/test/command_callback') call ale#test#SetDirectory('/testplugin/test/command_callback')
call ale#test#SetFilename('test.sh') call ale#test#SetFilename('test.sh')
let b:prefix = 'cd ' . ale#Escape(ale#path#Winify(g:dir)) . ' && ' let b:prefix = 'cd ' . ale#Escape(ale#path#Simplify(g:dir)) . ' && '
let b:suffix = ' -f gcc -' let b:suffix = ' -f gcc -'
After: After:

View file

@ -20,7 +20,7 @@ Execute(The default command should be correct):
Execute(The command should have the .rubocop.yml prepended as an env var if one exists): Execute(The command should have the .rubocop.yml prepended as an env var if one exists):
call ale#test#SetFilename('../slimlint-test-files/subdir/file.slim') call ale#test#SetFilename('../slimlint-test-files/subdir/file.slim')
let b:conf = ale#path#Winify(g:dir . '/../slimlint-test-files/.rubocop.yml') let b:conf = ale#path#Simplify(g:dir . '/../slimlint-test-files/.rubocop.yml')
if has('win32') if has('win32')
" Windows uses 'set var=... && command' " Windows uses 'set var=... && command'

View file

@ -27,7 +27,7 @@ After:
Execute(bin/cmd.js paths should be preferred): Execute(bin/cmd.js paths should be preferred):
call ale#test#SetFilename('standard-test-files/with-cmd/testfile.js') call ale#test#SetFilename('standard-test-files/with-cmd/testfile.js')
let b:executable = ale#path#Winify( let b:executable = ale#path#Simplify(
\ g:dir \ g:dir
\ . '/standard-test-files/with-cmd/node_modules/standard/bin/cmd.js' \ . '/standard-test-files/with-cmd/node_modules/standard/bin/cmd.js'
\) \)
@ -45,7 +45,7 @@ Execute(bin/cmd.js paths should be preferred):
Execute(.bin directories should be used too): Execute(.bin directories should be used too):
call ale#test#SetFilename('standard-test-files/with-bin/testfile.js') call ale#test#SetFilename('standard-test-files/with-bin/testfile.js')
let b:executable = ale#path#Winify( let b:executable = ale#path#Simplify(
\ g:dir \ g:dir
\ . '/standard-test-files/with-bin/node_modules/.bin/standard' \ . '/standard-test-files/with-bin/node_modules/.bin/standard'
\) \)

View file

@ -34,10 +34,10 @@ Execute(The yaml swaglint command callback should allow a local installation to
call ale#test#SetFilename('swaglint_paths/docs/swagger.yaml') call ale#test#SetFilename('swaglint_paths/docs/swagger.yaml')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/swaglint_paths/node_modules/.bin/swaglint'), \ ale#path#Simplify(g:dir . '/swaglint_paths/node_modules/.bin/swaglint'),
\ ale_linters#yaml#swaglint#GetExecutable(bufnr('')) \ ale_linters#yaml#swaglint#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/swaglint_paths/node_modules/.bin/swaglint') \ ale#path#Simplify(g:dir . '/swaglint_paths/node_modules/.bin/swaglint')
\ . ' -r compact --stdin', \ . ' -r compact --stdin',
\ ale_linters#yaml#swaglint#GetCommand(bufnr('')) \ ale_linters#yaml#swaglint#GetCommand(bufnr(''))

View file

@ -34,10 +34,10 @@ Execute(Should use the node_modules/.bin executable, if available):
call ale#test#SetFilename('write-good-node-modules/test.txt') call ale#test#SetFilename('write-good-node-modules/test.txt')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/write-good-node-modules/node_modules/.bin/write-good'), \ ale#path#Simplify(g:dir . '/write-good-node-modules/node_modules/.bin/write-good'),
\ ale#handlers#writegood#GetExecutable(bufnr('')) \ ale#handlers#writegood#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ ale#Escape(ale#path#Winify(g:dir . '/write-good-node-modules/node_modules/.bin/write-good')) \ ale#Escape(ale#path#Simplify(g:dir . '/write-good-node-modules/node_modules/.bin/write-good'))
\ . ' %t', \ . ' %t',
\ ale#handlers#writegood#GetCommand(bufnr('')) \ ale#handlers#writegood#GetCommand(bufnr(''))
@ -45,11 +45,11 @@ Execute(Should use the node_modules/write-good executable, if available):
call ale#test#SetFilename('write-good-node-modules-2/test.txt') call ale#test#SetFilename('write-good-node-modules-2/test.txt')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/write-good-node-modules-2/node_modules/write-good/bin/write-good.js'), \ ale#path#Simplify(g:dir . '/write-good-node-modules-2/node_modules/write-good/bin/write-good.js'),
\ ale#handlers#writegood#GetExecutable(bufnr('')) \ ale#handlers#writegood#GetExecutable(bufnr(''))
AssertEqual AssertEqual
\ (has('win32') ? 'node.exe ' : '') \ (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Winify(g:dir . '/write-good-node-modules-2/node_modules/write-good/bin/write-good.js')) \ . ale#Escape(ale#path#Simplify(g:dir . '/write-good-node-modules-2/node_modules/write-good/bin/write-good.js'))
\ . ' %t', \ . ' %t',
\ ale#handlers#writegood#GetCommand(bufnr('')) \ ale#handlers#writegood#GetCommand(bufnr(''))

View file

@ -515,7 +515,7 @@ Execute(ale#fix#InitBufferData() should set up the correct data):
\ bufnr(''): { \ bufnr(''): {
\ 'temporary_directory_list': [], \ 'temporary_directory_list': [],
\ 'vars': b:, \ 'vars': b:,
\ 'filename': ale#path#Winify(getcwd() . '/fix_test_file'), \ 'filename': ale#path#Simplify(getcwd() . '/fix_test_file'),
\ 'done': 0, \ 'done': 0,
\ 'lines_before': ['a', 'b', 'c'], \ 'lines_before': ['a', 'b', 'c'],
\ 'should_save': 1, \ 'should_save': 1,

View file

@ -27,7 +27,7 @@ Execute(The autopep8 callback should return the correct default values):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
AssertEqual AssertEqual
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/autopep8')) . ' -'}, \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/autopep8')) . ' -'},
\ ale#fixers#autopep8#Fix(bufnr('')) \ ale#fixers#autopep8#Fix(bufnr(''))
Execute(The autopep8 callback should include options): Execute(The autopep8 callback should include options):
@ -35,5 +35,5 @@ Execute(The autopep8 callback should include options):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
AssertEqual AssertEqual
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/autopep8')) . ' --some-option -' }, \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/autopep8')) . ' --some-option -' },
\ ale#fixers#autopep8#Fix(bufnr('')) \ ale#fixers#autopep8#Fix(bufnr(''))

View file

@ -15,7 +15,7 @@ Execute(The elm-format command should have default params):
\ { \ {
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\ 'command': \ 'command':
\ ale#Escape(ale#path#Winify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format')) \ ale#Escape(ale#path#Simplify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format'))
\ . ' %t --yes', \ . ' %t --yes',
\ }, \ },
\ ale#fixers#format#Fix(bufnr('')) \ ale#fixers#format#Fix(bufnr(''))
@ -55,7 +55,7 @@ Execute(The elm-format command should manage empty options):
\ { \ {
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\ 'command': \ 'command':
\ ale#Escape(ale#path#Winify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format')) \ ale#Escape(ale#path#Simplify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format'))
\ . ' %t', \ . ' %t',
\ }, \ },
\ ale#fixers#format#Fix(bufnr('')) \ ale#fixers#format#Fix(bufnr(''))
@ -68,7 +68,7 @@ Execute(The elm-format command should manage custom options):
\ { \ {
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\ 'command': \ 'command':
\ ale#Escape(ale#path#Winify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format')) \ ale#Escape(ale#path#Simplify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format'))
\ . ' %t --param1 --param2', \ . ' %t --param1 --param2',
\ }, \ },
\ ale#fixers#format#Fix(bufnr('')) \ ale#fixers#format#Fix(bufnr(''))

View file

@ -13,8 +13,8 @@ Execute(The executable path should be correct):
\ { \ {
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\ 'command': (has('win32') ? 'node.exe ' : '') \ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js')) \ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/.eslintrc.js')) \ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/.eslintrc.js'))
\ . ' --fix %t', \ . ' --fix %t',
\ }, \ },
\ ale#fixers#eslint#ApplyFixForVersion(bufnr(''), ['v4.4.1 (eslint_d v5.1.0)']) \ ale#fixers#eslint#ApplyFixForVersion(bufnr(''), ['v4.4.1 (eslint_d v5.1.0)'])
@ -26,8 +26,8 @@ Execute(The lower priority configuration file in a nested directory should be pr
\ { \ {
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\ 'command': (has('win32') ? 'node.exe ' : '') \ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js')) \ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/subdir-with-config/.eslintrc')) \ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/subdir-with-config/.eslintrc'))
\ . ' --fix %t', \ . ' --fix %t',
\ }, \ },
\ ale#fixers#eslint#ApplyFixForVersion(bufnr(''), []) \ ale#fixers#eslint#ApplyFixForVersion(bufnr(''), [])
@ -39,8 +39,8 @@ Execute(package.json should be used as a last resort):
\ { \ {
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\ 'command': (has('win32') ? 'node.exe ' : '') \ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js')) \ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/.eslintrc.js')) \ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/.eslintrc.js'))
\ . ' --fix %t', \ . ' --fix %t',
\ }, \ },
\ ale#fixers#eslint#ApplyFixForVersion(bufnr(''), []) \ ale#fixers#eslint#ApplyFixForVersion(bufnr(''), [])
@ -51,8 +51,8 @@ Execute(package.json should be used as a last resort):
\ { \ {
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\ 'command': \ 'command':
\ ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/node_modules/.bin/eslint')) \ ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/node_modules/.bin/eslint'))
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/package.json')) \ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/package.json'))
\ . ' --fix %t', \ . ' --fix %t',
\ }, \ },
\ ale#fixers#eslint#ApplyFixForVersion(bufnr(''), []) \ ale#fixers#eslint#ApplyFixForVersion(bufnr(''), [])
@ -64,7 +64,7 @@ Execute(The version check should be correct):
\ { \ {
\ 'chain_with': 'ale#fixers#eslint#ApplyFixForVersion', \ 'chain_with': 'ale#fixers#eslint#ApplyFixForVersion',
\ 'command': (has('win32') ? 'node.exe ' : '') \ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js')) \ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' --version' \ . ' --version'
\ }, \ },
\ ale#fixers#eslint#Fix(bufnr('')) \ ale#fixers#eslint#Fix(bufnr(''))
@ -75,7 +75,7 @@ Execute(--fix-dry-run should be used for 4.9.0 and up):
AssertEqual AssertEqual
\ { \ {
\ 'command': (has('win32') ? 'node.exe ' : '') \ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js')) \ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' --stdin-filename %s --stdin --fix-dry-run --format=json', \ . ' --stdin-filename %s --stdin --fix-dry-run --format=json',
\ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput', \ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput',
\ }, \ },
@ -88,8 +88,8 @@ Execute(--fix-to-stdout should be used for eslint_d):
\ { \ {
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\ 'command': \ 'command':
\ ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d')) \ ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'))
\ . ' -c ' . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/package.json')) \ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/package.json'))
\ . ' --fix %t', \ . ' --fix %t',
\ }, \ },
\ ale#fixers#eslint#ApplyFixForVersion(bufnr(''), ['']) \ ale#fixers#eslint#ApplyFixForVersion(bufnr(''), [''])
@ -99,7 +99,7 @@ Execute(--fix-to-stdout should be used for eslint_d):
AssertEqual AssertEqual
\ { \ {
\ 'command': \ 'command':
\ ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d')) \ ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'))
\ . ' --stdin-filename %s --stdin --fix-to-stdout', \ . ' --stdin-filename %s --stdin --fix-to-stdout',
\ 'process_with': 'ale#fixers#eslint#ProcessEslintDOutput', \ 'process_with': 'ale#fixers#eslint#ProcessEslintDOutput',
\ }, \ },
@ -109,7 +109,7 @@ Execute(--fix-to-stdout should be used for eslint_d):
AssertEqual AssertEqual
\ { \ {
\ 'command': \ 'command':
\ ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d')) \ ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'))
\ . ' --stdin-filename %s --stdin --fix-to-stdout', \ . ' --stdin-filename %s --stdin --fix-to-stdout',
\ 'process_with': 'ale#fixers#eslint#ProcessEslintDOutput', \ 'process_with': 'ale#fixers#eslint#ProcessEslintDOutput',
\ }, \ },
@ -133,7 +133,7 @@ Execute(The version number should be cached):
AssertEqual AssertEqual
\ { \ {
\ 'command': (has('win32') ? 'node.exe ' : '') \ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js')) \ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' --stdin-filename %s --stdin --fix-dry-run --format=json', \ . ' --stdin-filename %s --stdin --fix-dry-run --format=json',
\ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput', \ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput',
\ }, \ },

View file

@ -25,5 +25,5 @@ Execute(The isort callback should return the correct default values):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py') silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
AssertEqual AssertEqual
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/isort')) . ' -' }, \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/isort')) . ' -' },
\ ale#fixers#isort#Fix(bufnr('')) \ ale#fixers#isort#Fix(bufnr(''))

View file

@ -21,7 +21,7 @@ Execute(project with phpcbf should use local by default):
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php') call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf'), \ ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf'),
\ ale#fixers#phpcbf#GetExecutable(bufnr('')) \ ale#fixers#phpcbf#GetExecutable(bufnr(''))
Execute(use-global should override local detection): Execute(use-global should override local detection):
@ -43,7 +43,7 @@ Execute(The phpcbf callback should return the correct default values):
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php') call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
AssertEqual AssertEqual
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' }, \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
\ ale#fixers#phpcbf#Fix(bufnr('')) \ ale#fixers#phpcbf#Fix(bufnr(''))
Execute(The phpcbf callback should include the phpcbf_standard option): Execute(The phpcbf callback should include the phpcbf_standard option):
@ -51,7 +51,7 @@ Execute(The phpcbf callback should include the phpcbf_standard option):
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php') call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
AssertEqual AssertEqual
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'}, \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
\ ale#fixers#phpcbf#Fix(bufnr('')) \ ale#fixers#phpcbf#Fix(bufnr(''))
Before: Before:
@ -77,7 +77,7 @@ Execute(project with phpcbf should use local by default):
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php') call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf'), \ ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf'),
\ ale#fixers#phpcbf#GetExecutable(bufnr('')) \ ale#fixers#phpcbf#GetExecutable(bufnr(''))
Execute(use-global should override local detection): Execute(use-global should override local detection):
@ -99,7 +99,7 @@ Execute(The phpcbf callback should return the correct default values):
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php') call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
AssertEqual AssertEqual
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' }, \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
\ ale#fixers#phpcbf#Fix(bufnr('')) \ ale#fixers#phpcbf#Fix(bufnr(''))
Execute(The phpcbf callback should include the phpcbf_standard option): Execute(The phpcbf callback should include the phpcbf_standard option):
@ -107,6 +107,6 @@ Execute(The phpcbf callback should include the phpcbf_standard option):
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php') call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
AssertEqual AssertEqual
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'}, \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
\ ale#fixers#phpcbf#Fix(bufnr('')) \ ale#fixers#phpcbf#Fix(bufnr(''))

View file

@ -54,7 +54,7 @@ Execute(--eslint-config-path should be set for 4.2.0 and up):
\ 'command': \ 'command':
\ ale#Escape('prettier-eslint') \ ale#Escape('prettier-eslint')
\ . ' %t' \ . ' %t'
\ . ' --eslint-config-path ' . ale#Escape(ale#path#Winify(g:dir . '/eslint-test-files/react-app/.eslintrc.js')) \ . ' --eslint-config-path ' . ale#Escape(ale#path#Simplify(g:dir . '/eslint-test-files/react-app/.eslintrc.js'))
\ . ' --write' \ . ' --write'
\ }, \ },
\ ale#fixers#prettier_eslint#ApplyFixForVersion(bufnr(''), ['4.2.0']) \ ale#fixers#prettier_eslint#ApplyFixForVersion(bufnr(''), ['4.2.0'])
@ -87,7 +87,7 @@ Execute(The new --stdin-filepath option should be used when the version is new e
\ { \ {
\ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && ' \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
\ . ale#Escape('prettier-eslint') \ . ale#Escape('prettier-eslint')
\ . ' --eslint-config-path ' . ale#Escape(ale#path#Winify(g:dir . '/eslint-test-files/react-app/.eslintrc.js')) \ . ' --eslint-config-path ' . ale#Escape(ale#path#Simplify(g:dir . '/eslint-test-files/react-app/.eslintrc.js'))
\ . ' --stdin-filepath %s --stdin', \ . ' --stdin-filepath %s --stdin',
\ }, \ },
\ ale#fixers#prettier_eslint#ApplyFixForVersion(bufnr(''), ['4.4.0']) \ ale#fixers#prettier_eslint#ApplyFixForVersion(bufnr(''), ['4.4.0'])

View file

@ -34,7 +34,7 @@ Execute(The rubocop callback should include configuration files):
\ { \ {
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\ 'command': ale#Escape(g:ale_ruby_rubocop_executable) \ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
\ . ' --config ' . ale#Escape(ale#path#Winify(g:dir . '/ruby_paths/with_config/.rubocop.yml')) \ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/ruby_paths/with_config/.rubocop.yml'))
\ . ' --auto-correct %t', \ . ' --auto-correct %t',
\ }, \ },
\ ale#fixers#rubocop#Fix(bufnr('')) \ ale#fixers#rubocop#Fix(bufnr(''))
@ -47,7 +47,7 @@ Execute(The rubocop callback should include custom rubocop options):
\ { \ {
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\ 'command': ale#Escape(g:ale_ruby_rubocop_executable) \ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
\ . ' --config ' . ale#Escape(ale#path#Winify(g:dir . '/ruby_paths/with_config/.rubocop.yml')) \ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/ruby_paths/with_config/.rubocop.yml'))
\ . ' --except Lint/Debugger' \ . ' --except Lint/Debugger'
\ . ' --auto-correct %t', \ . ' --auto-correct %t',
\ }, \ },

View file

@ -11,7 +11,7 @@ Execute(The executable path should be correct):
\ { \ {
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\ 'command': (has('win32') ? 'node.exe ' : '') \ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/standard/bin/cmd.js')) \ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/standard/bin/cmd.js'))
\ . ' --fix %t', \ . ' --fix %t',
\ }, \ },
\ ale#fixers#standard#Fix(bufnr('')) \ ale#fixers#standard#Fix(bufnr(''))

View file

@ -11,7 +11,7 @@ Execute(The executable path should be correct):
\ { \ {
\ 'read_temporary_file': 1, \ 'read_temporary_file': 1,
\ 'command': (has('win32') ? 'node.exe ' : '') \ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Winify(g:dir . '/../eslint-test-files/react-app/node_modules/stylelint/bin/stylelint.js')) \ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/stylelint/bin/stylelint.js'))
\ . ' --fix %t', \ . ' --fix %t',
\ }, \ },
\ ale#fixers#stylelint#Fix(bufnr('')) \ ale#fixers#stylelint#Fix(bufnr(''))

View file

@ -26,7 +26,7 @@ Execute(The yapf callback should return the correct default values):
call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py') call ale#test#SetFilename('python_paths/with_virtualenv/subdir/foo/bar.py')
AssertEqual AssertEqual
\ {'command': ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/yapf'))}, \ {'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/yapf'))},
\ ale#fixers#yapf#Fix(bufnr('')) \ ale#fixers#yapf#Fix(bufnr(''))
\ \
Execute(The yapf should include the .style.yapf file if present): Execute(The yapf should include the .style.yapf file if present):
@ -35,8 +35,8 @@ Execute(The yapf should include the .style.yapf file if present):
AssertEqual AssertEqual
\ { \ {
\ 'command': \ 'command':
\ ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/yapf')) \ ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/yapf'))
\ . ' --no-local-style' \ . ' --no-local-style'
\ . ' --style ' . ale#Escape(ale#path#Winify(g:dir . '/python_paths/with_virtualenv/dir_with_yapf_config/.style.yapf')), \ . ' --style ' . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/dir_with_yapf_config/.style.yapf')),
\ }, \ },
\ ale#fixers#yapf#Fix(bufnr('')) \ ale#fixers#yapf#Fix(bufnr(''))

View file

@ -34,7 +34,7 @@ Execute(The brakeman handler should parse JSON correctly):
\ '"fingerprint": "1234",', \ '"fingerprint": "1234",',
\ '"check_name": "SQL",', \ '"check_name": "SQL",',
\ '"message": "Possible SQL injection",', \ '"message": "Possible SQL injection",',
\ '"file": "' . substitute(ale#path#Winify('app/models/thing.rb'), '\\', '\\\\', 'g') . '",', \ '"file": "' . substitute(ale#path#Simplify('app/models/thing.rb'), '\\', '\\\\', 'g') . '",',
\ '"line": 84,', \ '"line": 84,',
\ '"link": "http://brakemanscanner.org/docs/warning_types/sql_injection/",', \ '"link": "http://brakemanscanner.org/docs/warning_types/sql_injection/",',
\ '"code": "Thing.connection.execute(params[:data])",', \ '"code": "Thing.connection.execute(params[:data])",',
@ -53,7 +53,7 @@ Execute(The brakeman handler should parse JSON correctly):
\ '"fingerprint": "1235",', \ '"fingerprint": "1235",',
\ '"check_name": "ModelAttrAccessible",', \ '"check_name": "ModelAttrAccessible",',
\ '"message": "Potentially dangerous attribute available for mass assignment",', \ '"message": "Potentially dangerous attribute available for mass assignment",',
\ '"file": "' . substitute(ale#path#Winify('app/models/thing.rb'), '\\', '\\\\', 'g') . '",', \ '"file": "' . substitute(ale#path#Simplify('app/models/thing.rb'), '\\', '\\\\', 'g') . '",',
\ '"line": null,', \ '"line": null,',
\ '"link": "http://brakemanscanner.org/docs/warning_types/mass_assignment/",', \ '"link": "http://brakemanscanner.org/docs/warning_types/mass_assignment/",',
\ '"code": ":name",', \ '"code": ":name",',

View file

@ -48,11 +48,11 @@ Execute(The ghc handler should handle ghc 8 output):
\ ], \ ],
\ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [ \ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
\ '', \ '',
\ ale#path#Winify('src/Appoint/Lib.hs') . ':6:1: error:', \ ale#path#Simplify('src/Appoint/Lib.hs') . ':6:1: error:',
\ ' Failed to load interface for GitHub.Data', \ ' Failed to load interface for GitHub.Data',
\ ' Use -v to see a list of the files searched for.', \ ' Use -v to see a list of the files searched for.',
\ '', \ '',
\ ale#path#Winify('src/Appoint/Lib.hs') . ':7:1: warning:', \ ale#path#Simplify('src/Appoint/Lib.hs') . ':7:1: warning:',
\ ' Failed to load interface for GitHub.Endpoints.PullRequests', \ ' Failed to load interface for GitHub.Endpoints.PullRequests',
\ ' Use -v to see a list of the files searched for.', \ ' Use -v to see a list of the files searched for.',
\ ]) \ ])
@ -92,12 +92,12 @@ Execute(The ghc handler should handle ghc 7 output):
\ }, \ },
\ ], \ ],
\ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [ \ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
\ ale#path#Winify('src/Main.hs') . ':168:1:', \ ale#path#Simplify('src/Main.hs') . ':168:1:',
\ ' parse error (possibly incorrect indentation or mismatched brackets)', \ ' parse error (possibly incorrect indentation or mismatched brackets)',
\ ale#path#Winify('src/Main.hs') . ':84:1:Warning:', \ ale#path#Simplify('src/Main.hs') . ':84:1:Warning:',
\ ' Top-level binding with no type signature:', \ ' Top-level binding with no type signature:',
\ ' myLayout :: Choose Tall (Choose (Mirror Tall) Full) a', \ ' myLayout :: Choose Tall (Choose (Mirror Tall) Full) a',
\ ale#path#Winify('src/Main.hs') . ':94:5:Error:', \ ale#path#Simplify('src/Main.hs') . ':94:5:Error:',
\ ' Some other error', \ ' Some other error',
\ ]) \ ])
@ -122,7 +122,7 @@ Execute(The ghc handler should handle stack 1.5.1 output):
\ }, \ },
\ ], \ ],
\ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [ \ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
\ ' ' . ale#path#Winify('src/Main.hs') . ':160:14: error:', \ ' ' . ale#path#Simplify('src/Main.hs') . ':160:14: error:',
\ ' • Expecting one fewer arguments to Exp', \ ' • Expecting one fewer arguments to Exp',
\ ' Expected kind k0 -> *, but Exp has kind *', \ ' Expected kind k0 -> *, but Exp has kind *',
\ ' • In the type Exp a', \ ' • In the type Exp a',

View file

@ -37,7 +37,7 @@ Execute (The gobuild handler should handle relative paths correctly):
\ 'col': 0, \ 'col': 0,
\ 'text': 'missing argument for Printf("%s"): format reads arg 2, have only 1 args', \ 'text': 'missing argument for Printf("%s"): format reads arg 2, have only 1 args',
\ 'type': 'E', \ 'type': 'E',
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.go'), \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
\ }, \ },
\ ], \ ],
\ ale_linters#go#gobuild#Handler(bufnr(''), [ \ ale_linters#go#gobuild#Handler(bufnr(''), [

View file

@ -41,14 +41,14 @@ Execute (The gometalinter handler should handle paths correctly):
\ 'col': 3, \ 'col': 3,
\ 'text': 'expected ''package'', found ''IDENT'' gibberish (staticcheck)', \ 'text': 'expected ''package'', found ''IDENT'' gibberish (staticcheck)',
\ 'type': 'W', \ 'type': 'W',
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.go'), \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
\ }, \ },
\ { \ {
\ 'lnum': 37, \ 'lnum': 37,
\ 'col': 5, \ 'col': 5,
\ 'text': 'expected ''package'', found ''IDENT'' gibberish (golint)', \ 'text': 'expected ''package'', found ''IDENT'' gibberish (golint)',
\ 'type': 'E', \ 'type': 'E',
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.go'), \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.go'),
\ }, \ },
\ ], \ ],
\ ale_linters#go#gometalinter#Handler(bufnr(''), [ \ ale_linters#go#gometalinter#Handler(bufnr(''), [

View file

@ -69,13 +69,13 @@ Execute(The javac handler should resolve files from different directories):
AssertEqual AssertEqual
\ [ \ [
\ { \ {
\ 'filename': ale#path#Winify(g:dir . '/Foo.java'), \ 'filename': ale#path#Simplify(g:dir . '/Foo.java'),
\ 'lnum': 1, \ 'lnum': 1,
\ 'text': 'error: some error', \ 'text': 'error: some error',
\ 'type': 'E', \ 'type': 'E',
\ }, \ },
\ { \ {
\ 'filename': ale#path#Winify(g:dir . '/Bar.java'), \ 'filename': ale#path#Simplify(g:dir . '/Bar.java'),
\ 'lnum': 1, \ 'lnum': 1,
\ 'text': 'error: some error', \ 'text': 'error: some error',
\ 'type': 'E', \ 'type': 'E',

View file

@ -32,14 +32,14 @@ Execute(The lessc handler should handle errors for other files in the same direc
\ 'col': 1, \ 'col': 1,
\ 'type': 'E', \ 'type': 'E',
\ 'text': 'Unrecognised input. Possibly missing something', \ 'text': 'Unrecognised input. Possibly missing something',
\ 'filename': ale#path#Winify(g:dir . '/imported.less') \ 'filename': ale#path#Simplify(g:dir . '/imported.less')
\ }, \ },
\ { \ {
\ 'lnum': 2, \ 'lnum': 2,
\ 'col': 1, \ 'col': 1,
\ 'type': 'E', \ 'type': 'E',
\ 'text': 'Unrecognised input. Possibly missing something', \ 'text': 'Unrecognised input. Possibly missing something',
\ 'filename': ale#path#Winify(g:dir . '/imported.less') \ 'filename': ale#path#Simplify(g:dir . '/imported.less')
\ }, \ },
\ ], \ ],
\ ale_linters#less#lessc#Handle(bufnr(''), [ \ ale_linters#less#lessc#Handle(bufnr(''), [
@ -59,7 +59,7 @@ Execute(The lessc handler should handle errors for files in directories above co
\ 'col': 1, \ 'col': 1,
\ 'type': 'E', \ 'type': 'E',
\ 'text': 'Unrecognised input. Possibly missing something', \ 'text': 'Unrecognised input. Possibly missing something',
\ 'filename': ale#path#Winify(g:dir . '/../imported2.less') \ 'filename': ale#path#Simplify(g:dir . '/../imported2.less')
\ }, \ },
\ ], \ ],
\ ale_linters#less#lessc#Handle(bufnr(''), [ \ ale_linters#less#lessc#Handle(bufnr(''), [

View file

@ -18,7 +18,7 @@ Execute(The mcs handler should work with the default of the buffer's directory):
\ 'text': '; expected', \ 'text': '; expected',
\ 'code': 'CS1001', \ 'code': 'CS1001',
\ 'type': 'E', \ 'type': 'E',
\ 'filename': ale#path#Winify(expand('%:p:h') . '/Test.cs', 'add_drive'), \ 'filename': ale#path#Simplify(expand('%:p:h') . '/Test.cs'),
\ }, \ },
\ ], \ ],
\ ale_linters#cs#mcsc#Handle(347, [ \ ale_linters#cs#mcsc#Handle(347, [
@ -37,7 +37,7 @@ Execute(The mcs handler should handle cannot find symbol errors):
\ 'text': '; expected', \ 'text': '; expected',
\ 'code': 'CS1001', \ 'code': 'CS1001',
\ 'type': 'E', \ 'type': 'E',
\ 'filename': ale#path#Winify('/home/foo/project/bar/Test.cs', 'add_drive'), \ 'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'),
\ }, \ },
\ { \ {
\ 'lnum': 101, \ 'lnum': 101,
@ -45,7 +45,7 @@ Execute(The mcs handler should handle cannot find symbol errors):
\ 'text': 'Unexpected processor directive (no #if for this #endif)', \ 'text': 'Unexpected processor directive (no #if for this #endif)',
\ 'code': 'CS1028', \ 'code': 'CS1028',
\ 'type': 'E', \ 'type': 'E',
\ 'filename': ale#path#Winify('/home/foo/project/bar/Test.cs', 'add_drive'), \ 'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'),
\ }, \ },
\ { \ {
\ 'lnum': 10, \ 'lnum': 10,
@ -53,7 +53,7 @@ Execute(The mcs handler should handle cannot find symbol errors):
\ 'text': 'some warning', \ 'text': 'some warning',
\ 'code': 'CS0123', \ 'code': 'CS0123',
\ 'type': 'W', \ 'type': 'W',
\ 'filename': ale#path#Winify('/home/foo/project/bar/Test.cs', 'add_drive'), \ 'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'),
\ }, \ },
\ ], \ ],
\ ale_linters#cs#mcsc#Handle(347, [ \ ale_linters#cs#mcsc#Handle(347, [

View file

@ -15,35 +15,35 @@ Execute(The mypy handler should parse lines correctly):
\ { \ {
\ 'lnum': 768, \ 'lnum': 768,
\ 'col': 38, \ 'col': 38,
\ 'filename': ale#path#Winify(g:dir . '/baz.py'), \ 'filename': ale#path#Simplify(g:dir . '/baz.py'),
\ 'type': 'E', \ 'type': 'E',
\ 'text': 'Cannot determine type of ''SOME_SYMBOL''', \ 'text': 'Cannot determine type of ''SOME_SYMBOL''',
\ }, \ },
\ { \ {
\ 'lnum': 821, \ 'lnum': 821,
\ 'col': 38, \ 'col': 38,
\ 'filename': ale#path#Winify(g:dir . '/baz.py'), \ 'filename': ale#path#Simplify(g:dir . '/baz.py'),
\ 'type': 'E', \ 'type': 'E',
\ 'text': 'Cannot determine type of ''SOME_SYMBOL''', \ 'text': 'Cannot determine type of ''SOME_SYMBOL''',
\ }, \ },
\ { \ {
\ 'lnum': 38, \ 'lnum': 38,
\ 'col': 44, \ 'col': 44,
\ 'filename': ale#path#Winify(g:dir . '/other.py'), \ 'filename': ale#path#Simplify(g:dir . '/other.py'),
\ 'type': 'E', \ 'type': 'E',
\ 'text': 'Cannot determine type of ''ANOTHER_SYMBOL''', \ 'text': 'Cannot determine type of ''ANOTHER_SYMBOL''',
\ }, \ },
\ { \ {
\ 'lnum': 15, \ 'lnum': 15,
\ 'col': 3, \ 'col': 3,
\ 'filename': ale#path#Winify(g:dir . '/__init__.py'), \ 'filename': ale#path#Simplify(g:dir . '/__init__.py'),
\ 'type': 'E', \ 'type': 'E',
\ 'text': 'Argument 1 to "somefunc" has incompatible type "int"; expected "str"' \ 'text': 'Argument 1 to "somefunc" has incompatible type "int"; expected "str"'
\ }, \ },
\ { \ {
\ 'lnum': 72, \ 'lnum': 72,
\ 'col': 1, \ 'col': 1,
\ 'filename': ale#path#Winify(g:dir . '/__init__.py'), \ 'filename': ale#path#Simplify(g:dir . '/__init__.py'),
\ 'type': 'W', \ 'type': 'W',
\ 'text': 'Some warning', \ 'text': 'Some warning',
\ }, \ },

View file

@ -15,9 +15,9 @@ Execute(The Perl linter should ignore errors from other files):
\ {'lnum': '2', 'type': 'E', 'text': 'Compilation failed in require'}, \ {'lnum': '2', 'type': 'E', 'text': 'Compilation failed in require'},
\ ], \ ],
\ ale_linters#perl#perl#Handle(bufnr(''), [ \ ale_linters#perl#perl#Handle(bufnr(''), [
\ 'syntax error at ' . ale#path#Winify(g:dir . '/foo.pm') . ' line 4, near "aklsdfjmy "', \ 'syntax error at ' . ale#path#Simplify(g:dir . '/foo.pm') . ' line 4, near "aklsdfjmy "',
\ 'Compilation failed in require at ' . ale#path#Winify(g:dir . '/bar.pl') . ' line 2.', \ 'Compilation failed in require at ' . ale#path#Simplify(g:dir . '/bar.pl') . ' line 2.',
\ 'BEGIN failed--compilation aborted at ' . ale#path#Winify(g:dir . '/bar.pl') . ' line 2.', \ 'BEGIN failed--compilation aborted at ' . ale#path#Simplify(g:dir . '/bar.pl') . ' line 2.',
\ ]) \ ])
Execute(The Perl linter should complain about failing to locate modules): Execute(The Perl linter should complain about failing to locate modules):

View file

@ -8,21 +8,21 @@ Execute(Warning and error messages should be handled correctly):
AssertEqual AssertEqual
\ [ \ [
\ { \ {
\ 'filename': ale#path#Winify(expand('%:p:h') . '/bad_python.rst'), \ 'filename': ale#path#Simplify(expand('%:p:h') . '/bad_python.rst'),
\ 'lnum': 7, \ 'lnum': 7,
\ 'col': 0, \ 'col': 0,
\ 'type': 'W', \ 'type': 'W',
\ 'text': '(python) unexpected EOF while parsing', \ 'text': '(python) unexpected EOF while parsing',
\ }, \ },
\ { \ {
\ 'filename': ale#path#Winify(expand('%:p:h') . '/bad_cpp.rst'), \ 'filename': ale#path#Simplify(expand('%:p:h') . '/bad_cpp.rst'),
\ 'lnum': 9, \ 'lnum': 9,
\ 'col': 0, \ 'col': 0,
\ 'type': 'W', \ 'type': 'W',
\ 'text': '(cpp) error: ''x'' was not declared in this scope', \ 'text': '(cpp) error: ''x'' was not declared in this scope',
\ }, \ },
\ { \ {
\ 'filename': ale#path#Winify(expand('%:p:h') . '/bad_rst.rst'), \ 'filename': ale#path#Simplify(expand('%:p:h') . '/bad_rst.rst'),
\ 'lnum': 1, \ 'lnum': 1,
\ 'col': 0, \ 'col': 0,
\ 'type': 'E', \ 'type': 'E',

View file

@ -110,7 +110,7 @@ Execute(The Rust handler should handle cargo output):
\ 'byte_start': 11505, \ 'byte_start': 11505,
\ 'column_end': 8, \ 'column_end': 8,
\ 'column_start': 5, \ 'column_start': 5,
\ 'file_name': ale#path#Winify('src/playpen.rs'), \ 'file_name': ale#path#Simplify('src/playpen.rs'),
\ 'is_primary': v:true, \ 'is_primary': v:true,
\ 'label': v:null, \ 'label': v:null,
\ 'line_end': 15, \ 'line_end': 15,
@ -130,7 +130,7 @@ Execute(The Rust handler should handle cargo output):
\ 'byte_start': 11494, \ 'byte_start': 11494,
\ 'column_end': 10, \ 'column_end': 10,
\ 'column_start': 7, \ 'column_start': 7,
\ 'file_name': ale#path#Winify('src/playpen.rs'), \ 'file_name': ale#path#Simplify('src/playpen.rs'),
\ 'is_primary': v:true, \ 'is_primary': v:true,
\ 'label': v:null, \ 'label': v:null,
\ 'line_end': 13, \ 'line_end': 13,
@ -174,7 +174,7 @@ Execute(The Rust handler should should errors from expansion spans):
\ 'byte_start': 1, \ 'byte_start': 1,
\ 'column_end': 1, \ 'column_end': 1,
\ 'column_start': 1, \ 'column_start': 1,
\ 'file_name': ale#path#Winify('src/other.rs'), \ 'file_name': ale#path#Simplify('src/other.rs'),
\ 'is_primary': v:true, \ 'is_primary': v:true,
\ 'label': 'some other error', \ 'label': 'some other error',
\ 'line_end': 4, \ 'line_end': 4,
@ -185,7 +185,7 @@ Execute(The Rust handler should should errors from expansion spans):
\ 'byte_start': 52, \ 'byte_start': 52,
\ 'column_end': 23, \ 'column_end': 23,
\ 'column_start': 21, \ 'column_start': 21,
\ 'file_name': ale#path#Winify('src/playpen.rs'), \ 'file_name': ale#path#Simplify('src/playpen.rs'),
\ 'is_primary': v:true, \ 'is_primary': v:true,
\ 'label': 'expected bool, found integral variable', \ 'label': 'expected bool, found integral variable',
\ 'line_end': 4, \ 'line_end': 4,
@ -227,7 +227,7 @@ Execute(The Rust handler should show detailed errors):
\ 'column_end': 23, \ 'column_end': 23,
\ 'column_start': 21, \ 'column_start': 21,
\ 'expansion': v:null, \ 'expansion': v:null,
\ 'file_name': ale#path#Winify('src/playpen.rs'), \ 'file_name': ale#path#Simplify('src/playpen.rs'),
\ 'is_primary': v:true, \ 'is_primary': v:true,
\ 'label': 'expected bool, found integral variable', \ 'label': 'expected bool, found integral variable',
\ 'line_end': 4, \ 'line_end': 4,

View file

@ -27,7 +27,7 @@ Execute(The tslint handler should parse lines correctly):
\ { \ {
\ 'lnum': 1, \ 'lnum': 1,
\ 'col': 15, \ 'col': 15,
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.ts'), \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.ts'),
\ 'end_lnum': 1, \ 'end_lnum': 1,
\ 'type': 'E', \ 'type': 'E',
\ 'end_col': 15, \ 'end_col': 15,
@ -37,7 +37,7 @@ Execute(The tslint handler should parse lines correctly):
\ { \ {
\ 'lnum': 2, \ 'lnum': 2,
\ 'col': 8, \ 'col': 8,
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.ts'), \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.ts'),
\ 'end_lnum': 3, \ 'end_lnum': 3,
\ 'type': 'W', \ 'type': 'W',
\ 'end_col': 12, \ 'end_col': 12,
@ -46,7 +46,7 @@ Execute(The tslint handler should parse lines correctly):
\ { \ {
\ 'lnum': 2, \ 'lnum': 2,
\ 'col': 8, \ 'col': 8,
\ 'filename': ale#path#Winify(expand('%:p:h') . '/something-else.ts'), \ 'filename': ale#path#Simplify(expand('%:p:h') . '/something-else.ts'),
\ 'end_lnum': 3, \ 'end_lnum': 3,
\ 'type': 'W', \ 'type': 'W',
\ 'end_col': 12, \ 'end_col': 12,
@ -56,7 +56,7 @@ Execute(The tslint handler should parse lines correctly):
\ { \ {
\ 'lnum': 31, \ 'lnum': 31,
\ 'col': 9, \ 'col': 9,
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.ts'), \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.ts'),
\ 'end_lnum': 31, \ 'end_lnum': 31,
\ 'type': 'E', \ 'type': 'E',
\ 'end_col': 20, \ 'end_col': 20,
@ -157,7 +157,7 @@ Execute(The tslint handler report errors for empty files by default):
\ { \ {
\ 'lnum': 2, \ 'lnum': 2,
\ 'col': 1, \ 'col': 1,
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.ts'), \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.ts'),
\ 'end_lnum': 2, \ 'end_lnum': 2,
\ 'type': 'E', \ 'type': 'E',
\ 'end_col': 1, \ 'end_col': 1,
@ -231,7 +231,7 @@ Execute(The tslint handler should report errors when the ignore option is on, bu
\ { \ {
\ 'lnum': 2, \ 'lnum': 2,
\ 'col': 1, \ 'col': 1,
\ 'filename': ale#path#Winify(expand('%:p:h') . '/test.ts'), \ 'filename': ale#path#Simplify(expand('%:p:h') . '/test.ts'),
\ 'end_lnum': 2, \ 'end_lnum': 2,
\ 'type': 'E', \ 'type': 'E',
\ 'end_col': 1, \ 'end_col': 1,

View file

@ -150,7 +150,7 @@ Execute(ale#lsp#tsserver_message#Open() should return correct messages):
\ 1, \ 1,
\ 'ts@open', \ 'ts@open',
\ { \ {
\ 'file': ale#path#Winify(g:dir . '/foo/bar.ts'), \ 'file': ale#path#Simplify(g:dir . '/foo/bar.ts'),
\ } \ }
\ ], \ ],
\ ale#lsp#tsserver_message#Open(bufnr('')) \ ale#lsp#tsserver_message#Open(bufnr(''))
@ -161,7 +161,7 @@ Execute(ale#lsp#tsserver_message#Close() should return correct messages):
\ 1, \ 1,
\ 'ts@close', \ 'ts@close',
\ { \ {
\ 'file': ale#path#Winify(g:dir . '/foo/bar.ts'), \ 'file': ale#path#Simplify(g:dir . '/foo/bar.ts'),
\ } \ }
\ ], \ ],
\ ale#lsp#tsserver_message#Close(bufnr('')) \ ale#lsp#tsserver_message#Close(bufnr(''))
@ -172,7 +172,7 @@ Execute(ale#lsp#tsserver_message#Change() should return correct messages):
\ 1, \ 1,
\ 'ts@change', \ 'ts@change',
\ { \ {
\ 'file': ale#path#Winify(g:dir . '/foo/bar.ts'), \ 'file': ale#path#Simplify(g:dir . '/foo/bar.ts'),
\ 'line': 1, \ 'line': 1,
\ 'offset': 1, \ 'offset': 1,
\ 'endLine': 1073741824, \ 'endLine': 1073741824,
@ -188,7 +188,7 @@ Execute(ale#lsp#tsserver_message#Geterr() should return correct messages):
\ 1, \ 1,
\ 'ts@geterr', \ 'ts@geterr',
\ { \ {
\ 'files': [ale#path#Winify(g:dir . '/foo/bar.ts')], \ 'files': [ale#path#Simplify(g:dir . '/foo/bar.ts')],
\ } \ }
\ ], \ ],
\ ale#lsp#tsserver_message#Geterr(bufnr('')) \ ale#lsp#tsserver_message#Geterr(bufnr(''))
@ -199,7 +199,7 @@ Execute(ale#lsp#tsserver_message#Completions() should return correct messages):
\ 0, \ 0,
\ 'ts@completions', \ 'ts@completions',
\ { \ {
\ 'file': ale#path#Winify(g:dir . '/foo/bar.ts'), \ 'file': ale#path#Simplify(g:dir . '/foo/bar.ts'),
\ 'line': 347, \ 'line': 347,
\ 'offset': 12, \ 'offset': 12,
\ 'prefix': 'abc', \ 'prefix': 'abc',
@ -213,7 +213,7 @@ Execute(ale#lsp#tsserver_message#CompletionEntryDetails() should return correct
\ 0, \ 0,
\ 'ts@completionEntryDetails', \ 'ts@completionEntryDetails',
\ { \ {
\ 'file': ale#path#Winify(g:dir . '/foo/bar.ts'), \ 'file': ale#path#Simplify(g:dir . '/foo/bar.ts'),
\ 'line': 347, \ 'line': 347,
\ 'offset': 12, \ 'offset': 12,
\ 'entryNames': ['foo', 'bar'], \ 'entryNames': ['foo', 'bar'],
@ -227,7 +227,7 @@ Execute(ale#lsp#tsserver_message#Definition() should return correct messages):
\ 0, \ 0,
\ 'ts@definition', \ 'ts@definition',
\ { \ {
\ 'file': ale#path#Winify(g:dir . '/foo/bar.ts'), \ 'file': ale#path#Simplify(g:dir . '/foo/bar.ts'),
\ 'line': 347, \ 'line': 347,
\ 'offset': 12, \ 'offset': 12,
\ } \ }

View file

@ -39,8 +39,8 @@ Execute(The C GCC handler should include 'include' directories for projects with
AssertEqual AssertEqual
\ ale#Escape('gcc') \ ale#Escape('gcc')
\ . ' -S -x c -fsyntax-only ' \ . ' -S -x c -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/include')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/include')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#c#gcc#GetCommand(bufnr('')) \ , ale_linters#c#gcc#GetCommand(bufnr(''))
@ -52,8 +52,8 @@ Execute(The C GCC handler should include 'include' directories for projects with
AssertEqual AssertEqual
\ ale#Escape('gcc') \ ale#Escape('gcc')
\ . ' -S -x c -fsyntax-only ' \ . ' -S -x c -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/configure_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/configure_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/configure_project/include')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/configure_project/include')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#c#gcc#GetCommand(bufnr('')) \ , ale_linters#c#gcc#GetCommand(bufnr(''))
@ -65,8 +65,8 @@ Execute(The C GCC handler should include root directories for projects with .h f
AssertEqual AssertEqual
\ ale#Escape('gcc') \ ale#Escape('gcc')
\ . ' -S -x c -fsyntax-only ' \ . ' -S -x c -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#c#gcc#GetCommand(bufnr('')) \ , ale_linters#c#gcc#GetCommand(bufnr(''))
@ -78,8 +78,8 @@ Execute(The C GCC handler should include root directories for projects with .hpp
AssertEqual AssertEqual
\ ale#Escape('gcc') \ ale#Escape('gcc')
\ . ' -S -x c -fsyntax-only ' \ . ' -S -x c -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#c#gcc#GetCommand(bufnr('')) \ , ale_linters#c#gcc#GetCommand(bufnr(''))
@ -91,8 +91,8 @@ Execute(The C Clang handler should include 'include' directories for projects wi
AssertEqual AssertEqual
\ ale#Escape('clang') \ ale#Escape('clang')
\ . ' -S -x c -fsyntax-only ' \ . ' -S -x c -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/include')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/include')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#c#clang#GetCommand(bufnr('')) \ , ale_linters#c#clang#GetCommand(bufnr(''))
@ -104,8 +104,8 @@ Execute(The C Clang handler should include 'include' directories for projects wi
AssertEqual AssertEqual
\ ale#Escape('clang') \ ale#Escape('clang')
\ . ' -S -x c -fsyntax-only ' \ . ' -S -x c -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#c#clang#GetCommand(bufnr('')) \ , ale_linters#c#clang#GetCommand(bufnr(''))
@ -117,8 +117,8 @@ Execute(The C Clang handler should include root directories for projects with .h
AssertEqual AssertEqual
\ ale#Escape('clang') \ ale#Escape('clang')
\ . ' -S -x c -fsyntax-only ' \ . ' -S -x c -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#c#clang#GetCommand(bufnr('')) \ , ale_linters#c#clang#GetCommand(bufnr(''))
@ -130,8 +130,8 @@ Execute(The C Clang handler should include root directories for projects with .h
AssertEqual AssertEqual
\ ale#Escape('clang') \ ale#Escape('clang')
\ . ' -S -x c -fsyntax-only ' \ . ' -S -x c -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#c#clang#GetCommand(bufnr('')) \ , ale_linters#c#clang#GetCommand(bufnr(''))
@ -143,8 +143,8 @@ Execute(The C++ GCC handler should include 'include' directories for projects wi
AssertEqual AssertEqual
\ ale#Escape('gcc') \ ale#Escape('gcc')
\ . ' -S -x c++ -fsyntax-only ' \ . ' -S -x c++ -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/include')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/include')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#cpp#gcc#GetCommand(bufnr('')) \ , ale_linters#cpp#gcc#GetCommand(bufnr(''))
@ -156,8 +156,8 @@ Execute(The C++ GCC handler should include 'include' directories for projects wi
AssertEqual AssertEqual
\ ale#Escape('gcc') \ ale#Escape('gcc')
\ . ' -S -x c++ -fsyntax-only ' \ . ' -S -x c++ -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/configure_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/configure_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/configure_project/include')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/configure_project/include')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#cpp#gcc#GetCommand(bufnr('')) \ , ale_linters#cpp#gcc#GetCommand(bufnr(''))
@ -169,8 +169,8 @@ Execute(The C++ GCC handler should include root directories for projects with .h
AssertEqual AssertEqual
\ ale#Escape('gcc') \ ale#Escape('gcc')
\ . ' -S -x c++ -fsyntax-only ' \ . ' -S -x c++ -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#cpp#gcc#GetCommand(bufnr('')) \ , ale_linters#cpp#gcc#GetCommand(bufnr(''))
@ -182,8 +182,8 @@ Execute(The C++ GCC handler should include root directories for projects with .h
AssertEqual AssertEqual
\ ale#Escape('gcc') \ ale#Escape('gcc')
\ . ' -S -x c++ -fsyntax-only ' \ . ' -S -x c++ -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#cpp#gcc#GetCommand(bufnr('')) \ , ale_linters#cpp#gcc#GetCommand(bufnr(''))
@ -195,8 +195,8 @@ Execute(The C++ Clang handler should include 'include' directories for projects
AssertEqual AssertEqual
\ ale#Escape('clang++') \ ale#Escape('clang++')
\ . ' -S -x c++ -fsyntax-only ' \ . ' -S -x c++ -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/makefile_project/include')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/include')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#cpp#clang#GetCommand(bufnr('')) \ , ale_linters#cpp#clang#GetCommand(bufnr(''))
@ -208,8 +208,8 @@ Execute(The C++ Clang handler should include 'include' directories for projects
AssertEqual AssertEqual
\ ale#Escape('clang++') \ ale#Escape('clang++')
\ . ' -S -x c++ -fsyntax-only ' \ . ' -S -x c++ -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/configure_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/configure_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/configure_project/include')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/configure_project/include')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#cpp#clang#GetCommand(bufnr('')) \ , ale_linters#cpp#clang#GetCommand(bufnr(''))
@ -221,8 +221,8 @@ Execute(The C++ Clang handler should include root directories for projects with
AssertEqual AssertEqual
\ ale#Escape('clang++') \ ale#Escape('clang++')
\ . ' -S -x c++ -fsyntax-only ' \ . ' -S -x c++ -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/h_file_project')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/h_file_project')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#cpp#clang#GetCommand(bufnr('')) \ , ale_linters#cpp#clang#GetCommand(bufnr(''))
@ -234,8 +234,8 @@ Execute(The C++ Clang handler should include root directories for projects with
AssertEqual AssertEqual
\ ale#Escape('clang++') \ ale#Escape('clang++')
\ . ' -S -x c++ -fsyntax-only ' \ . ' -S -x c++ -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project/subdir')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/hpp_file_project')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/hpp_file_project')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#cpp#clang#GetCommand(bufnr('')) \ , ale_linters#cpp#clang#GetCommand(bufnr(''))
@ -255,8 +255,8 @@ Execute(The C++ Clang handler shoud use the include directory based on the .git
AssertEqual AssertEqual
\ ale#Escape('clang++') \ ale#Escape('clang++')
\ . ' -S -x c++ -fsyntax-only ' \ . ' -S -x c++ -fsyntax-only '
\ . '-iquote ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/git_and_nested_makefiles/src')) . ' ' \ . '-iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/git_and_nested_makefiles/src')) . ' '
\ . ' -I' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/git_and_nested_makefiles/include')) . ' ' \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/git_and_nested_makefiles/include')) . ' '
\ . ' -' \ . ' -'
\ , ale_linters#cpp#clang#GetCommand(bufnr('')) \ , ale_linters#cpp#clang#GetCommand(bufnr(''))
@ -268,7 +268,7 @@ Execute(The C++ ClangTidy handler should include json folders for projects with
AssertEqual AssertEqual
\ ale#Escape('clang-tidy') \ ale#Escape('clang-tidy')
\ . ' -checks=' . ale#Escape('*') . ' %s ' \ . ' -checks=' . ale#Escape('*') . ' %s '
\ . '-p ' . ale#Escape(ale#path#Winify(g:dir . '/test_c_projects/json_project/build')) \ . '-p ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/json_project/build'))
\ , ale_linters#cpp#clangtidy#GetCommand(bufnr('')) \ , ale_linters#cpp#clangtidy#GetCommand(bufnr(''))
Execute(Move .git/HEAD back): Execute(Move .git/HEAD back):

View file

@ -13,7 +13,7 @@ Execute(--config should be set when the .csslintrc file is found):
AssertEqual AssertEqual
\ ( \ (
\ 'csslint --format=compact ' \ 'csslint --format=compact '
\ . '--config=' . ale#Escape(ale#path#Winify(g:dir . '/csslint-test-files/some-app/.csslintrc')) \ . '--config=' . ale#Escape(ale#path#Simplify(g:dir . '/csslint-test-files/some-app/.csslintrc'))
\ . ' %t' \ . ' %t'
\ ), \ ),
\ ale_linters#css#csslint#GetCommand(bufnr('')) \ ale_linters#css#csslint#GetCommand(bufnr(''))

View file

@ -12,7 +12,7 @@ Execute(should get valid executable with default params):
call ale#test#SetFilename('elm-test-files/app/testfile.elm') call ale#test#SetFilename('elm-test-files/app/testfile.elm')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/elm-test-files/app/node_modules/.bin/elm-make'), \ ale#path#Simplify(g:dir . '/elm-test-files/app/node_modules/.bin/elm-make'),
\ ale_linters#elm#make#GetExecutable(bufnr('')) \ ale_linters#elm#make#GetExecutable(bufnr(''))
Execute(should get valid executable with 'use_global' params): Execute(should get valid executable with 'use_global' params):

View file

@ -17,7 +17,7 @@ Execute(create-react-app directories should be detected correctly):
call ale#test#SetFilename('eslint-test-files/react-app/subdir/testfile.js') call ale#test#SetFilename('eslint-test-files/react-app/subdir/testfile.js')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'), \ ale#path#Simplify(g:dir . '/eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'),
\ ale#handlers#eslint#GetExecutable(bufnr('')) \ ale#handlers#eslint#GetExecutable(bufnr(''))
Execute(use-global should override create-react-app detection): Execute(use-global should override create-react-app detection):
@ -33,7 +33,7 @@ Execute(other app directories should be detected correctly):
call ale#test#SetFilename('eslint-test-files/other-app/subdir/testfile.js') call ale#test#SetFilename('eslint-test-files/other-app/subdir/testfile.js')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/eslint-test-files/node_modules/.bin/eslint'), \ ale#path#Simplify(g:dir . '/eslint-test-files/node_modules/.bin/eslint'),
\ ale#handlers#eslint#GetExecutable(bufnr('')) \ ale#handlers#eslint#GetExecutable(bufnr(''))
Execute(use-global should override other app directories): Execute(use-global should override other app directories):
@ -49,7 +49,7 @@ Execute(eslint_d should be detected correctly):
call ale#test#SetFilename('eslint-test-files/app-with-eslint-d/testfile.js') call ale#test#SetFilename('eslint-test-files/app-with-eslint-d/testfile.js')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'), \ ale#path#Simplify(g:dir . '/eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'),
\ ale#handlers#eslint#GetExecutable(bufnr('')) \ ale#handlers#eslint#GetExecutable(bufnr(''))
Execute(eslint.js executables should be run with node on Windows): Execute(eslint.js executables should be run with node on Windows):
@ -59,6 +59,6 @@ Execute(eslint.js executables should be run with node on Windows):
" We have to execute the file with node. " We have to execute the file with node.
AssertEqual AssertEqual
\ ale#Escape('node.exe') . ' ' \ ale#Escape('node.exe') . ' '
\ . ale#Escape(ale#path#Winify(g:dir . '/eslint-test-files/react-app/node_modules/eslint/bin/eslint.js')) \ . ale#Escape(ale#path#Simplify(g:dir . '/eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' -f unix --stdin --stdin-filename %s', \ . ' -f unix --stdin --stdin-filename %s',
\ ale#handlers#eslint#GetCommand(bufnr('')) \ ale#handlers#eslint#GetCommand(bufnr(''))

View file

@ -8,7 +8,7 @@ Execute(We should be able to find a directory some directory down):
call ale#test#SetFilename('top/middle/bottom/dummy.txt') call ale#test#SetFilename('top/middle/bottom/dummy.txt')
AssertEqual AssertEqual
\ ale#path#Winify(expand('%:p:h:h:h:h') . '/top/ale-special-directory-name-dont-use-this-please/'), \ ale#path#Simplify(expand('%:p:h:h:h:h') . '/top/ale-special-directory-name-dont-use-this-please/'),
\ ale#path#FindNearestDirectory(bufnr('%'), 'ale-special-directory-name-dont-use-this-please') \ ale#path#FindNearestDirectory(bufnr('%'), 'ale-special-directory-name-dont-use-this-please')
Execute(We shouldn't find anything for files which don't match): Execute(We shouldn't find anything for files which don't match):

View file

@ -70,7 +70,7 @@ Execute(Other files should be jumped to for definition responses):
\ 'success': v:true, \ 'success': v:true,
\ 'body': [ \ 'body': [
\ { \ {
\ 'file': ale#path#Winify(g:dir . '/completion_dummy_file'), \ 'file': ale#path#Simplify(g:dir . '/completion_dummy_file'),
\ 'start': {'line': 3, 'offset': 7}, \ 'start': {'line': 3, 'offset': 7},
\ }, \ },
\ ], \ ],
@ -79,7 +79,7 @@ Execute(Other files should be jumped to for definition responses):
AssertEqual AssertEqual
\ [ \ [
\ 'edit ' . fnameescape(ale#path#Winify(g:dir . '/completion_dummy_file')), \ 'edit ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
\ ], \ ],
\ g:expr_list \ g:expr_list
AssertEqual [3, 7], getpos('.')[1:2] AssertEqual [3, 7], getpos('.')[1:2]
@ -95,7 +95,7 @@ Execute(Other files should be jumped to for definition responses in tabs too):
\ 'success': v:true, \ 'success': v:true,
\ 'body': [ \ 'body': [
\ { \ {
\ 'file': ale#path#Winify(g:dir . '/completion_dummy_file'), \ 'file': ale#path#Simplify(g:dir . '/completion_dummy_file'),
\ 'start': {'line': 3, 'offset': 7}, \ 'start': {'line': 3, 'offset': 7},
\ }, \ },
\ ], \ ],
@ -104,7 +104,7 @@ Execute(Other files should be jumped to for definition responses in tabs too):
AssertEqual AssertEqual
\ [ \ [
\ 'tabedit ' . fnameescape(ale#path#Winify(g:dir . '/completion_dummy_file')), \ 'tabedit ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
\ ], \ ],
\ g:expr_list \ g:expr_list
AssertEqual [3, 7], getpos('.')[1:2] AssertEqual [3, 7], getpos('.')[1:2]
@ -150,7 +150,7 @@ Execute(Other files should be jumped to for LSP definition responses):
\ { \ {
\ 'id': 3, \ 'id': 3,
\ 'result': { \ 'result': {
\ 'uri': ale#path#ToURI(ale#path#Winify(g:dir . '/completion_dummy_file')), \ 'uri': ale#path#ToURI(ale#path#Simplify(g:dir . '/completion_dummy_file')),
\ 'range': { \ 'range': {
\ 'start': {'line': 2, 'character': 7}, \ 'start': {'line': 2, 'character': 7},
\ }, \ },
@ -160,7 +160,7 @@ Execute(Other files should be jumped to for LSP definition responses):
AssertEqual AssertEqual
\ [ \ [
\ 'edit ' . fnameescape(ale#path#Winify(g:dir . '/completion_dummy_file')), \ 'edit ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
\ ], \ ],
\ g:expr_list \ g:expr_list
AssertEqual [3, 7], getpos('.')[1:2] AssertEqual [3, 7], getpos('.')[1:2]
@ -173,7 +173,7 @@ Execute(Other files should be jumped to in tabs for LSP definition responses):
\ { \ {
\ 'id': 3, \ 'id': 3,
\ 'result': { \ 'result': {
\ 'uri': ale#path#ToURI(ale#path#Winify(g:dir . '/completion_dummy_file')), \ 'uri': ale#path#ToURI(ale#path#Simplify(g:dir . '/completion_dummy_file')),
\ 'range': { \ 'range': {
\ 'start': {'line': 2, 'character': 7}, \ 'start': {'line': 2, 'character': 7},
\ }, \ },
@ -183,7 +183,7 @@ Execute(Other files should be jumped to in tabs for LSP definition responses):
AssertEqual AssertEqual
\ [ \ [
\ 'tabedit ' . fnameescape(ale#path#Winify(g:dir . '/completion_dummy_file')), \ 'tabedit ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
\ ], \ ],
\ g:expr_list \ g:expr_list
AssertEqual [3, 7], getpos('.')[1:2] AssertEqual [3, 7], getpos('.')[1:2]
@ -197,13 +197,13 @@ Execute(Definition responses with lists should be handled):
\ 'id': 3, \ 'id': 3,
\ 'result': [ \ 'result': [
\ { \ {
\ 'uri': ale#path#ToURI(ale#path#Winify(g:dir . '/completion_dummy_file')), \ 'uri': ale#path#ToURI(ale#path#Simplify(g:dir . '/completion_dummy_file')),
\ 'range': { \ 'range': {
\ 'start': {'line': 2, 'character': 7}, \ 'start': {'line': 2, 'character': 7},
\ }, \ },
\ }, \ },
\ { \ {
\ 'uri': ale#path#ToURI(ale#path#Winify(g:dir . '/other_file')), \ 'uri': ale#path#ToURI(ale#path#Simplify(g:dir . '/other_file')),
\ 'range': { \ 'range': {
\ 'start': {'line': 20, 'character': 3}, \ 'start': {'line': 20, 'character': 3},
\ }, \ },
@ -214,7 +214,7 @@ Execute(Definition responses with lists should be handled):
AssertEqual AssertEqual
\ [ \ [
\ 'edit ' . fnameescape(ale#path#Winify(g:dir . '/completion_dummy_file')), \ 'edit ' . fnameescape(ale#path#Simplify(g:dir . '/completion_dummy_file')),
\ ], \ ],
\ g:expr_list \ g:expr_list
AssertEqual [3, 7], getpos('.')[1:2] AssertEqual [3, 7], getpos('.')[1:2]

View file

@ -10,7 +10,7 @@ Before:
let g:command_tail = ' -I ' . ale#Escape(ale#gradle#GetInitPath()) let g:command_tail = ' -I ' . ale#Escape(ale#gradle#GetInitPath())
\ . ' -q printClasspath' \ . ' -q printClasspath'
let g:gradle_init_path = ale#path#Winify(g:dir . '../../autoload/ale/gradle/init.gradle') let g:gradle_init_path = ale#path#Simplify(g:dir . '../../autoload/ale/gradle/init.gradle')
After: After:
Restore Restore
@ -25,18 +25,18 @@ Execute(Should return 'gradlew' command if project includes gradle wapper):
call ale#test#SetFilename('gradle-test-files/wrapped-project/src/main/kotlin/dummy.kt') call ale#test#SetFilename('gradle-test-files/wrapped-project/src/main/kotlin/dummy.kt')
AssertEqual AssertEqual
\ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/gradle-test-files/wrapped-project')) \ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/gradle-test-files/wrapped-project'))
\ . ' && ' . ale#Escape(ale#path#Winify(g:dir . '/gradle-test-files/wrapped-project/gradlew')) \ . ' && ' . ale#Escape(ale#path#Simplify(g:dir . '/gradle-test-files/wrapped-project/gradlew'))
\ . g:command_tail, \ . g:command_tail,
\ ale#gradle#BuildClasspathCommand(bufnr('')) \ ale#gradle#BuildClasspathCommand(bufnr(''))
Execute(Should return 'gradle' command if project does not include gradle wapper): Execute(Should return 'gradle' command if project does not include gradle wapper):
call ale#test#SetFilename('gradle-test-files/unwrapped-project/src/main/kotlin/dummy.kt') call ale#test#SetFilename('gradle-test-files/unwrapped-project/src/main/kotlin/dummy.kt')
let $PATH .= (has('win32') ? ';' : ':') let $PATH .= (has('win32') ? ';' : ':')
\ . ale#path#Winify(g:dir . '/gradle-test-files') \ . ale#path#Simplify(g:dir . '/gradle-test-files')
AssertEqual AssertEqual
\ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/gradle-test-files/unwrapped-project')) \ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/gradle-test-files/unwrapped-project'))
\ . ' && ' . ale#Escape('gradle') \ . ' && ' . ale#Escape('gradle')
\ . g:command_tail, \ . g:command_tail,
\ ale#gradle#BuildClasspathCommand(bufnr('')) \ ale#gradle#BuildClasspathCommand(bufnr(''))

View file

@ -18,12 +18,12 @@ Execute(Should return 'gradlew' if found in parent directory):
call ale#test#SetFilename('gradle-test-files/wrapped-project/src/main/kotlin/dummy.kt') call ale#test#SetFilename('gradle-test-files/wrapped-project/src/main/kotlin/dummy.kt')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/gradle-test-files/wrapped-project/gradlew'), \ ale#path#Simplify(g:dir . '/gradle-test-files/wrapped-project/gradlew'),
\ ale#gradle#FindExecutable(bufnr('')) \ ale#gradle#FindExecutable(bufnr(''))
Execute(Should return 'gradle' if 'gradlew' not found in parent directory): Execute(Should return 'gradle' if 'gradlew' not found in parent directory):
call ale#test#SetFilename('gradle-test-files/unwrapped-project/src/main/kotlin/dummy.kt') call ale#test#SetFilename('gradle-test-files/unwrapped-project/src/main/kotlin/dummy.kt')
let $PATH .= (has('win32') ? ';': ':') . ale#path#Winify(g:dir . '/gradle-test-files') let $PATH .= (has('win32') ? ';': ':') . ale#path#Simplify(g:dir . '/gradle-test-files')
AssertEqual AssertEqual
\ 'gradle', \ 'gradle',

View file

@ -10,21 +10,21 @@ Execute(Should return directory for 'gradlew' if found in parent directory):
call ale#test#SetFilename('gradle-test-files/wrapped-project/src/main/kotlin/dummy.kt') call ale#test#SetFilename('gradle-test-files/wrapped-project/src/main/kotlin/dummy.kt')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/gradle-test-files/wrapped-project'), \ ale#path#Simplify(g:dir . '/gradle-test-files/wrapped-project'),
\ ale#gradle#FindProjectRoot(bufnr('')) \ ale#gradle#FindProjectRoot(bufnr(''))
Execute(Should return directory for 'settings.gradle' if found in parent directory): Execute(Should return directory for 'settings.gradle' if found in parent directory):
call ale#test#SetFilename('gradle-test-files/settings-gradle-project/src/main/kotlin/dummy.kt') call ale#test#SetFilename('gradle-test-files/settings-gradle-project/src/main/kotlin/dummy.kt')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/gradle-test-files/settings-gradle-project'), \ ale#path#Simplify(g:dir . '/gradle-test-files/settings-gradle-project'),
\ ale#gradle#FindProjectRoot(bufnr('')) \ ale#gradle#FindProjectRoot(bufnr(''))
Execute(Should return directory for 'build.gradle' if found in parent directory): Execute(Should return directory for 'build.gradle' if found in parent directory):
call ale#test#SetFilename('gradle-test-files/build-gradle-project/src/main/kotlin/dummy.kt') call ale#test#SetFilename('gradle-test-files/build-gradle-project/src/main/kotlin/dummy.kt')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/gradle-test-files/build-gradle-project'), \ ale#path#Simplify(g:dir . '/gradle-test-files/build-gradle-project'),
\ ale#gradle#FindProjectRoot(bufnr('')) \ ale#gradle#FindProjectRoot(bufnr(''))
Execute(Should return empty string if gradle files are not found in parent directory): Execute(Should return empty string if gradle files are not found in parent directory):

View file

@ -42,7 +42,7 @@ Execute(The loclist titles should be set appropriately):
if !has('nvim') if !has('nvim')
AssertEqual AssertEqual
\ {'title': ale#path#Winify(getcwd() . '/foo')}, \ {'title': ale#path#Simplify(getcwd() . '/foo')},
\ getloclist(0, {'title': ''}) \ getloclist(0, {'title': ''})
endif endif
@ -72,6 +72,6 @@ Execute(The quickfix titles should be set appropriately):
if !has('nvim') if !has('nvim')
AssertEqual AssertEqual
\ {'title': ale#path#Winify(getcwd() . '/foo')}, \ {'title': ale#path#Simplify(getcwd() . '/foo')},
\ getqflist({'title': ''}) \ getqflist({'title': ''})
endif endif

View file

@ -8,7 +8,7 @@ Execute(We should be able to find a configuration file further up):
call ale#test#SetFilename('top/middle/bottom/dummy.txt') call ale#test#SetFilename('top/middle/bottom/dummy.txt')
AssertEqual AssertEqual
\ ale#path#Winify(expand('%:p:h:h:h:h') . '/top/example.ini'), \ ale#path#Simplify(expand('%:p:h:h:h:h') . '/top/example.ini'),
\ ale#path#FindNearestFile(bufnr('%'), 'example.ini') \ ale#path#FindNearestFile(bufnr('%'), 'example.ini')
Execute(We shouldn't find anything for files which don't match): Execute(We shouldn't find anything for files which don't match):

View file

@ -1,6 +1,6 @@
Before: Before:
function! CheckPath(path) abort function! CheckPath(path) abort
return ale#path#IsBufferPath(bufnr(''), ale#path#Winify(a:path)) return ale#path#IsBufferPath(bufnr(''), ale#path#Simplify(a:path))
endfunction endfunction
After: After:

View file

@ -19,7 +19,7 @@ Execute(project with phpcs should use local by default):
call ale#test#SetFilename('phpcs-test-files/project-with-phpcs/foo/test.php') call ale#test#SetFilename('phpcs-test-files/project-with-phpcs/foo/test.php')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/phpcs-test-files/project-with-phpcs/vendor/bin/phpcs'), \ ale#path#Simplify(g:dir . '/phpcs-test-files/project-with-phpcs/vendor/bin/phpcs'),
\ ale_linters#php#phpcs#GetExecutable(bufnr('')) \ ale_linters#php#phpcs#GetExecutable(bufnr(''))
Execute(use-global should override local detection): Execute(use-global should override local detection):

View file

@ -8,7 +8,7 @@ Execute(We should be able to find the local version of a file):
call ale#test#SetFilename('top/middle/bottom/dummy.txt') call ale#test#SetFilename('top/middle/bottom/dummy.txt')
AssertEqual AssertEqual
\ ale#path#Winify(expand('%:p:h:h:h:h') . '/top/example.ini'), \ ale#path#Simplify(expand('%:p:h:h:h:h') . '/top/example.ini'),
\ ale#path#ResolveLocalPath(bufnr('%'), 'example.ini', '/global/config.ini') \ ale#path#ResolveLocalPath(bufnr('%'), 'example.ini', '/global/config.ini')
Execute(We shouldn't find anything for files which don't match): Execute(We shouldn't find anything for files which don't match):

View file

@ -9,14 +9,14 @@ Execute(smlnj finds CM file if it exists):
call ale#test#SetFilename('smlnj/cm/foo.sml') call ale#test#SetFilename('smlnj/cm/foo.sml')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/smlnj/cm/sources.cm'), \ ale#path#Simplify(g:dir . '/smlnj/cm/sources.cm'),
\ ale#handlers#sml#GetCmFile(bufnr('%')) \ ale#handlers#sml#GetCmFile(bufnr('%'))
Execute(smlnj finds CM file by searching upwards): Execute(smlnj finds CM file by searching upwards):
call ale#test#SetFilename('smlnj/cm/path/to/bar.sml') call ale#test#SetFilename('smlnj/cm/path/to/bar.sml')
AssertEqual AssertEqual
\ ale#path#Winify(g:dir . '/smlnj/cm/sources.cm'), \ ale#path#Simplify(g:dir . '/smlnj/cm/sources.cm'),
\ ale#handlers#sml#GetCmFile(bufnr('%')) \ ale#handlers#sml#GetCmFile(bufnr('%'))
Execute(smlnj returns '' when no CM file found): Execute(smlnj returns '' when no CM file found):

View file

@ -12,7 +12,7 @@ Execute(adjacent config file should be found):
\ ( \ (
\ ale#Escape('tflint') \ ale#Escape('tflint')
\ . ' --config ' \ . ' --config '
\ . ale#Escape(ale#path#Winify(g:dir . '/tflint-test-files/foo/.tflint.hcl')) \ . ale#Escape(ale#path#Simplify(g:dir . '/tflint-test-files/foo/.tflint.hcl'))
\ . ' -f json %t' \ . ' -f json %t'
\ ), \ ),
\ ale_linters#terraform#tflint#GetCommand(bufnr('')) \ ale_linters#terraform#tflint#GetCommand(bufnr(''))