#3633 - Put all dummy test files in test/test-files

This commit is contained in:
w0rp
2021-03-20 22:11:22 +00:00
parent 3838ae118d
commit b1d833417b
581 changed files with 1027 additions and 1123 deletions

View File

@@ -1,2 +0,0 @@
[flake8]
max-line-length = 90

View File

@@ -71,7 +71,7 @@ Execute(The astyle callback should return the correct default values with a spec
\ ale#fixers#astyle#Fix(bufnr(''))
Execute(The astyle callback should find nearest default option file _astylrc):
call ale#test#SetFilename('../test_c_projects/makefile_project/subdir/file.c')
call ale#test#SetFilename('../test-files/c/makefile_project/subdir/file.c')
let targetfile = bufname(bufnr('%'))
AssertEqual
@@ -83,7 +83,7 @@ Execute(The astyle callback should find nearest default option file _astylrc):
\ ale#fixers#astyle#Fix(bufnr(''))
Execute(The astyle callback should find .astylrc in the same directory as src):
call ale#test#SetFilename('../test_cpp_project/dummy.cpp')
call ale#test#SetFilename('../test-files/cpp/dummy.cpp')
set filetype=cpp " The test fails without this
let targetfile = bufname(bufnr('%'))

View File

@@ -25,11 +25,11 @@ Execute(The autoimport callback should return the correct default values):
\ 0,
\ ale#fixers#autoimport#Fix(bufnr(''))
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
AssertEqual
\ {
\ 'cwd': '%s:h',
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/autoimport')) . ' -',
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/autoimport')) . ' -',
\ },
\ ale#fixers#autoimport#Fix(bufnr(''))
@@ -40,11 +40,11 @@ Execute(The autoimport callback should respect custom options):
\ 0,
\ ale#fixers#autoimport#Fix(bufnr(''))
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
AssertEqual
\ {
\ 'cwd': '%s:h',
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/autoimport'))
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/autoimport'))
\ . ' --multi-line=3 --trailing-comma -',
\ },
\ ale#fixers#autoimport#Fix(bufnr(''))

View File

@@ -25,15 +25,15 @@ Execute(The autopep8 callback should return the correct default values):
\ 0,
\ ale#fixers#autopep8#Fix(bufnr(''))
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
AssertEqual
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/autopep8')) . ' -'},
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/autopep8')) . ' -'},
\ ale#fixers#autopep8#Fix(bufnr(''))
Execute(The autopep8 callback should include options):
let g:ale_python_autopep8_options = '--some-option'
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
AssertEqual
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/autopep8')) . ' --some-option -' },
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/autopep8')) . ' --some-option -' },
\ ale#fixers#autopep8#Fix(bufnr(''))

View File

@@ -12,7 +12,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The bibclean callback should return the correct default values):
call ale#test#SetFilename('../command_callback/bib_paths/dummy.bib')
call ale#test#SetFilename('../command_callback/../test-files/bib/dummy.bib')
AssertEqual
\ {'command': ale#Escape(g:ale_bib_bibclean_executable) . ' -align-equals'},
@@ -20,7 +20,7 @@ Execute(The bibclean callback should return the correct default values):
Execute(The bibclean callback should include custom bibclean options):
let g:ale_bib_bibclean_options = '-author -check-values'
call ale#test#SetFilename('../command_callback/bib_paths/dummy.bib')
call ale#test#SetFilename('../command_callback/../test-files/bib/dummy.bib')
AssertEqual
\ {

View File

@@ -13,36 +13,36 @@ After:
unlet! b:bin_dir
Execute(The black 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 . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
AssertEqual
\ {
\ 'cwd': '%s:h',
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/black')) . ' -'},
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/black')) . ' -'},
\ ale#fixers#black#Fix(bufnr(''))
Execute(The black callback should include options):
let g:ale_python_black_options = '--some-option'
let g:ale_python_black_change_directory = 0
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
AssertEqual
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/black')) . ' --some-option -' },
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/black')) . ' --some-option -' },
\ ale#fixers#black#Fix(bufnr(''))
Execute(The black callback should include --pyi for .pyi files):
let g:ale_python_black_change_directory = 0
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.pyi')
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.pyi')
AssertEqual
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/black')) . ' --pyi -' },
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/black')) . ' --pyi -' },
\ ale#fixers#black#Fix(bufnr(''))
Execute(Pipenv is detected when python_black_auto_pipenv is set):
let g:ale_python_black_auto_pipenv = 1
let g:ale_python_black_change_directory = 0
call ale#test#SetFilename('../python_fixtures/pipenv/whatever.py')
call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
AssertEqual
\ {'command': ale#Escape('pipenv') . ' run black -'},

View File

@@ -22,7 +22,7 @@ Execute(Long lines with basic function calls should be broken up correctly):
\ ])
Execute(Longer lines should be permitted if a configuration file allows it):
call ale#test#SetFilename('long-line-project/foo/bar.py')
call ale#test#SetFilename('../test-files/long-line/foo/bar.py')
AssertEqual
\ [

View File

@@ -6,7 +6,7 @@ After:
call ale#assert#TearDownFixerTest()
Execute(The buildifier callback should return the correct default values):
call ale#test#SetFilename('bazel_paths/WORKSPACE')
call ale#test#SetFilename('../test-files/bazel/WORKSPACE')
AssertFixer
\ {
@@ -15,7 +15,7 @@ Execute(The buildifier callback should return the correct default values):
\ }
Execute(The buildifier callback should include any additional options):
call ale#test#SetFilename('bazel_paths/WORKSPACE')
call ale#test#SetFilename('../test-files/bazel/WORKSPACE')
let g:ale_bazel_buildifier_options = '--some-option'
AssertFixer
@@ -25,7 +25,7 @@ Execute(The buildifier callback should include any additional options):
\ }
Execute(The buildifier callback should recognize BUILD files):
call ale#test#SetFilename('bazel_paths/BUILD')
call ale#test#SetFilename('../test-files/bazel/BUILD')
AssertFixer
\ {
@@ -34,7 +34,7 @@ Execute(The buildifier callback should recognize BUILD files):
\ }
Execute(The buildifier callback should recognize .bzl files):
call ale#test#SetFilename('bazel_paths/defs.bzl')
call ale#test#SetFilename('../test-files/bazel/defs.bzl')
AssertFixer
\ {

View File

@@ -17,7 +17,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The clang-format callback should return the correct default values):
call ale#test#SetFilename('c_paths/dummy.c')
call ale#test#SetFilename('../test-files/c/dummy.c')
AssertEqual
\ {
@@ -27,7 +27,7 @@ Execute(The clang-format callback should return the correct default values):
\ ale#fixers#clangformat#Fix(bufnr(''))
Execute(The clangformat callback should include any additional options):
call ale#test#SetFilename('c_paths/dummy.c')
call ale#test#SetFilename('../test-files/c/dummy.c')
let g:ale_c_clangformat_options = '--some-option'
AssertEqual
@@ -39,7 +39,7 @@ Execute(The clangformat callback should include any additional options):
\ ale#fixers#clangformat#Fix(bufnr(''))
Execute(The clangformat callback should include style options as well):
call ale#test#SetFilename('c_paths/dummy.c')
call ale#test#SetFilename('../test-files/c/dummy.c')
let g:ale_c_clangformat_options = '--some-option'
let g:ale_c_clangformat_style_option = '{BasedOnStyle: Microsoft, ColumnLimit:80,}'
@@ -52,7 +52,7 @@ Execute(The clangformat callback should include style options as well):
\ ale#fixers#clangformat#Fix(bufnr(''))
Execute(The clangformat callback should use local file instead of style options):
call ale#test#SetFilename('clangformat_paths/with_clangformat/dummy.c')
call ale#test#SetFilename('../test-files/clangformat/with_clangformat/dummy.c')
let g:ale_c_clangformat_options = '--some-option'
let g:ale_c_clangformat_style_option = '{BasedOnStyle: Microsoft, ColumnLimit:80,}'
let g:ale_c_clangformat_use_local_file = 1

View File

@@ -26,7 +26,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The clangtidy callback should return the correct default values):
call ale#test#SetFilename('c_paths/dummy.c')
call ale#test#SetFilename('../test-files/c/dummy.c')
AssertEqual
\ {
@@ -37,7 +37,7 @@ Execute(The clangtidy callback should return the correct default values):
\ ale#fixers#clangtidy#Fix(bufnr(''))
Execute(The clangtidy callback should include any additional options):
call ale#test#SetFilename('c_paths/dummy.c')
call ale#test#SetFilename('../test-files/c/dummy.c')
let g:ale_c_clangtidy_extra_options = '--some-option'
AssertEqual

View File

@@ -14,7 +14,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The dartfmt callback should return the correct default values):
call ale#test#SetFilename('../dart_files/testfile.dart')
call ale#test#SetFilename('../test-files/dart/testfile.dart')
AssertEqual
\ {
@@ -27,7 +27,7 @@ Execute(The dartfmt callback should return the correct default values):
Execute(The dartfmt callback should include custom dartfmt options):
let g:ale_dart_dartfmt_options = "-l 80"
call ale#test#SetFilename('../dart_files/testfile.dart')
call ale#test#SetFilename('../test-files/dart/testfile.dart')
AssertEqual
\ {

View File

@@ -14,7 +14,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The dfmt callback should return the correct default values):
call ale#test#SetFilename('../d_files/test.d')
call ale#test#SetFilename('../test-files/d/test.d')
AssertEqual
\ {
@@ -27,7 +27,7 @@ Execute(The dfmt callback should return the correct default values):
Execute(The dfmt callback should include custom dfmt options):
let g:ale_d_dfmt_options = "--space-after-cast"
call ale#test#SetFilename('../d_files/test.d')
call ale#test#SetFilename('../test-files/d/test.d')
AssertEqual
\ {

View File

@@ -9,19 +9,19 @@ After:
call ale#test#RestoreDirectory()
Execute(The elm-format command should have default params):
call ale#test#SetFilename('../elm-test-files/src/subdir/testfile.elm')
call ale#test#SetFilename('../test-files/elm/src/subdir/testfile.elm')
AssertEqual
\ {
\ 'read_temporary_file': 1,
\ 'command':
\ ale#Escape(ale#path#Simplify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format'))
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/elm/node_modules/.bin/elm-format'))
\ . ' %t --yes',
\ },
\ ale#fixers#elm_format#Fix(bufnr(''))
Execute(The elm-format command should manage use_global = 1 param):
call ale#test#SetFilename('../elm-test-files/src/subdir/testfile.elm')
call ale#test#SetFilename('../test-files/elm/src/subdir/testfile.elm')
let b:ale_elm_format_use_global = 1
AssertEqual
@@ -34,7 +34,7 @@ Execute(The elm-format command should manage use_global = 1 param):
\ ale#fixers#elm_format#Fix(bufnr(''))
Execute(The elm-format command should manage executable param):
call ale#test#SetFilename('../elm-test-files/src/subdir/testfile.elm')
call ale#test#SetFilename('../test-files/elm/src/subdir/testfile.elm')
let b:ale_elm_format_use_global = 1
let b:ale_elm_format_executable = 'elmformat'
@@ -48,27 +48,27 @@ Execute(The elm-format command should manage executable param):
\ ale#fixers#elm_format#Fix(bufnr(''))
Execute(The elm-format command should manage empty options):
call ale#test#SetFilename('../elm-test-files/src/subdir/testfile.elm')
call ale#test#SetFilename('../test-files/elm/src/subdir/testfile.elm')
let b:ale_elm_format_options = ''
AssertEqual
\ {
\ 'read_temporary_file': 1,
\ 'command':
\ ale#Escape(ale#path#Simplify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format'))
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/elm/node_modules/.bin/elm-format'))
\ . ' %t',
\ },
\ ale#fixers#elm_format#Fix(bufnr(''))
Execute(The elm-format command should manage custom options):
call ale#test#SetFilename('../elm-test-files/src/subdir/testfile.elm')
call ale#test#SetFilename('../test-files/elm/src/subdir/testfile.elm')
let b:ale_elm_format_options = '--param1 --param2'
AssertEqual
\ {
\ 'read_temporary_file': 1,
\ 'command':
\ ale#Escape(ale#path#Simplify(g:dir . '/../elm-test-files/node_modules/.bin/elm-format'))
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/elm/node_modules/.bin/elm-format'))
\ . ' %t --param1 --param2',
\ },
\ ale#fixers#elm_format#Fix(bufnr(''))

View File

@@ -10,17 +10,17 @@ After:
call ale#assert#TearDownFixerTest()
Execute(The executable path should be correct):
call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.js')
call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.js')
" eslint_d output with an older eslint version is used here.
GivenCommandOutput ['v4.4.1 (eslint_d v5.1.0)']
AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'cwd': ale#path#Simplify(g:dir . '/../eslint-test-files/react-app'),
\ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/.eslintrc.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/.eslintrc.js'))
\ . ' --fix %t',
\ }
@@ -162,29 +162,29 @@ Execute(The ESLint fixer should use a config file option if set for new versions
\ }
Execute(The lower priority configuration file in a nested directory should be preferred):
call ale#test#SetFilename('../eslint-test-files/react-app/subdir-with-config/testfile.js')
call ale#test#SetFilename('../test-files/eslint/react-app/subdir-with-config/testfile.js')
AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'cwd': ale#path#Simplify(g:dir . '/../eslint-test-files/react-app'),
\ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/subdir-with-config/.eslintrc'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/subdir-with-config/.eslintrc'))
\ . ' --fix %t',
\ }
Execute(--config in options should override configuration file detection for old versions):
call ale#test#SetFilename('../eslint-test-files/react-app/subdir-with-config/testfile.js')
call ale#test#SetFilename('../test-files/eslint/react-app/subdir-with-config/testfile.js')
let b:ale_javascript_eslint_options = '--config /foo.cfg'
AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'cwd': ale#path#Simplify(g:dir . '/../eslint-test-files/react-app'),
\ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' --config /foo.cfg'
\ . ' --fix %t',
\ }
@@ -194,50 +194,50 @@ Execute(--config in options should override configuration file detection for old
AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'cwd': ale#path#Simplify(g:dir . '/../eslint-test-files/react-app'),
\ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' -c /foo.cfg'
\ . ' --fix %t',
\ }
Execute(package.json should be used as a last resort):
call ale#test#SetFilename('../eslint-test-files/react-app/subdir-with-package-json/testfile.js')
call ale#test#SetFilename('../test-files/eslint/react-app/subdir-with-package-json/testfile.js')
AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'cwd': ale#path#Simplify(g:dir . '/../eslint-test-files/react-app'),
\ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/.eslintrc.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/.eslintrc.js'))
\ . ' --fix %t',
\ }
call ale#test#SetFilename('../eslint-test-files/package.json')
call ale#test#SetFilename('../test-files/eslint/package.json')
AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'cwd': ale#path#Simplify(g:dir . '/../eslint-test-files'),
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/node_modules/.bin/eslint'))
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/package.json'))
\ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint'),
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/node_modules/.bin/eslint'))
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/package.json'))
\ . ' --fix %t',
\ }
Execute(The version check should be correct):
call ale#test#SetFilename('../eslint-test-files/react-app/subdir-with-config/testfile.js')
call ale#test#SetFilename('../test-files/eslint/react-app/subdir-with-config/testfile.js')
" We should run the command to get the version the first time.
GivenCommandOutput ['4.9.0']
AssertFixer [
\ (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' --version',
\ {
\ 'cwd': ale#path#Simplify(g:dir . '/../eslint-test-files/react-app'),
\ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' --stdin-filename %s --stdin --fix-dry-run --format=json',
\ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput',
\ },
@@ -245,36 +245,36 @@ Execute(The version check should be correct):
AssertFixer [
\ {
\ 'cwd': ale#path#Simplify(g:dir . '/../eslint-test-files/react-app'),
\ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' --stdin-filename %s --stdin --fix-dry-run --format=json',
\ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput',
\ },
\]
Execute(--fix-dry-run should be used for 4.9.0 and up):
call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.js')
call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.js')
GivenCommandOutput ['4.9.0']
AssertFixer
\ {
\ 'cwd': ale#path#Simplify(g:dir . '/../eslint-test-files/react-app'),
\ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/react-app'),
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/eslint/bin/eslint.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/eslint/bin/eslint.js'))
\ . ' --stdin-filename %s --stdin --fix-dry-run --format=json',
\ 'process_with': 'ale#fixers#eslint#ProcessFixDryRunOutput',
\ }
Execute(--fix-to-stdout should be used for eslint_d):
call ale#test#SetFilename('../eslint-test-files/app-with-eslint-d/testfile.js')
call ale#test#SetFilename('../test-files/eslint/app-with-eslint-d/testfile.js')
AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'cwd': ale#path#Simplify(g:dir . '/../eslint-test-files/app-with-eslint-d'),
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'))
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/package.json'))
\ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/app-with-eslint-d'),
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/app-with-eslint-d/node_modules/.bin/eslint_d'))
\ . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/package.json'))
\ . ' --fix %t',
\ }
@@ -283,8 +283,8 @@ Execute(--fix-to-stdout should be used for eslint_d):
GivenCommandOutput ['v3.19.0 (eslint_d v4.2.0)']
AssertFixer
\ {
\ 'cwd': ale#path#Simplify(g:dir . '/../eslint-test-files/app-with-eslint-d'),
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'))
\ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/app-with-eslint-d'),
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/app-with-eslint-d/node_modules/.bin/eslint_d'))
\ . ' --stdin-filename %s --stdin --fix-to-stdout',
\ 'process_with': 'ale#fixers#eslint#ProcessEslintDOutput',
\ }
@@ -293,8 +293,8 @@ Execute(--fix-to-stdout should be used for eslint_d):
GivenCommandOutput ['4.9.0']
AssertFixer
\ {
\ 'cwd': ale#path#Simplify(g:dir . '/../eslint-test-files/app-with-eslint-d'),
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d'))
\ 'cwd': ale#path#Simplify(g:dir . '/../test-files/eslint/app-with-eslint-d'),
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/app-with-eslint-d/node_modules/.bin/eslint_d'))
\ . ' --stdin-filename %s --stdin --fix-to-stdout',
\ 'process_with': 'ale#fixers#eslint#ProcessEslintDOutput',
\ }

View File

@@ -6,7 +6,7 @@ After:
call ale#assert#TearDownFixerTest()
Execute(The fecs fixer should respect to g:ale_javascript_fecs_executable):
let g:ale_javascript_fecs_executable = 'fecs_paths/fecs'
let g:ale_javascript_fecs_executable = '../test-files/fecs/fecs'
let g:ale_javascript_fecs_use_global = 1
silent cd ../command_callback
let g:dir = getcwd()

View File

@@ -14,7 +14,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The fish_indent callback should return the correct default values):
call ale#test#SetFilename('../fish_files/testfile.fish')
call ale#test#SetFilename('../test-files/fish/testfile.fish')
AssertEqual
\ {
@@ -27,7 +27,7 @@ Execute(The fish_indent callback should return the correct default values):
Execute(The fish_indent callback should include custom fish_indent options):
let g:ale_fish_fish_indent_options = "-d"
call ale#test#SetFilename('../fish_files/testfile.fish')
call ale#test#SetFilename('../test-files/fish/testfile.fish')
AssertEqual
\ {

View File

@@ -20,7 +20,7 @@ Execute(The fixjson callback should return the correct default command):
\ ale#fixers#fixjson#Fix(bufnr(''))
Execute(The fixjson callback should set the buffer name as file name):
call ale#test#SetFilename('../json_files/testfile.json')
call ale#test#SetFilename('../test-files/json/testfile.json')
AssertEqual
\ {

View File

@@ -8,7 +8,7 @@ After:
call ale#assert#TearDownFixerTest()
Execute(The default command should be correct):
call ale#test#SetFilename('../ada_files/testfile.adb')
call ale#test#SetFilename('../test-files/ada/testfile.adb')
AssertFixer
\ {
@@ -17,7 +17,7 @@ Execute(The default command should be correct):
\ }
Execute(The version check should be correct):
call ale#test#SetFilename('../ada_files/testfile.adb')
call ale#test#SetFilename('../test-files/ada/testfile.adb')
let g:ale_ada_gnatpp_options = '--no-alignment'
AssertFixer

View File

@@ -17,7 +17,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The gofmt callback should return the correct default values):
call ale#test#SetFilename('../go_files/testfile.go')
call ale#test#SetFilename('../test-files/go/testfile.go')
AssertEqual
\ {
@@ -28,7 +28,7 @@ Execute(The gofmt callback should return the correct default values):
Execute(The gofmt callback should include custom gofmt options):
let g:ale_go_gofmt_options = "-r '(a) -> a'"
call ale#test#SetFilename('../go_files/testfile.go')
call ale#test#SetFilename('../test-files/go/testfile.go')
AssertEqual
\ {
@@ -40,7 +40,7 @@ Execute(The gofmt callback should include custom gofmt options):
Execute(The gofmt callback should support Go environment variables):
let g:ale_go_go111module = 'off'
call ale#test#SetFilename('../go_files/testfile.go')
call ale#test#SetFilename('../test-files/go/testfile.go')
AssertEqual
\ {

View File

@@ -8,7 +8,7 @@ Before:
let g:ale_go_goimports_options = ''
call ale#test#SetDirectory('/testplugin/test/fixers')
call ale#test#SetFilename('../go_files/testfile.go')
call ale#test#SetFilename('../test-files/go/testfile.go')
After:
Restore

View File

@@ -15,7 +15,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The gomod callback should return the correct default values):
call ale#test#SetFilename('../go_files/go.mod')
call ale#test#SetFilename('../test-files/go/go.mod')
setl filetype=gomod
AssertEqual
@@ -28,7 +28,7 @@ Execute(The gomod callback should return the correct default values):
\ ale#fixers#gomod#Fix(bufnr(''))
Execute(The gomod callback should support Go environment variables):
call ale#test#SetFilename('../go_files/go.mod')
call ale#test#SetFilename('../test-files/go/go.mod')
setl filetype=gomod
let g:ale_go_go111module = 'on'

View File

@@ -5,7 +5,7 @@ Before:
let g:ale_javascript_importjs_executable = 'xxxinvalid'
call ale#test#SetDirectory('/testplugin/test/fixers')
call ale#test#SetFilename('../javascript_files/test.js')
call ale#test#SetFilename('../test-files/javascript/test.js')
After:
Restore

View File

@@ -17,11 +17,11 @@ Execute(The isort callback should return the correct default values):
\ 0,
\ ale#fixers#isort#Fix(bufnr(''))
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
AssertEqual
\ {
\ 'cwd': '%s:h',
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/isort')) . ' -',
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/isort')) . ' -',
\ },
\ ale#fixers#isort#Fix(bufnr(''))
@@ -32,11 +32,11 @@ Execute(The isort callback should respect custom options):
\ 0,
\ ale#fixers#isort#Fix(bufnr(''))
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
AssertEqual
\ {
\ 'cwd': '%s:h',
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/isort'))
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/isort'))
\ . ' --multi-line=3 --trailing-comma -',
\ },
\ ale#fixers#isort#Fix(bufnr(''))
@@ -44,7 +44,7 @@ Execute(The isort callback should respect custom options):
Execute(Pipenv is detected when python_isort_auto_pipenv is set):
let g:ale_python_isort_auto_pipenv = 1
call ale#test#SetFilename('../python_fixtures/pipenv/whatever.py')
call ale#test#SetFilename('../test-files/python/pipenv/whatever.py')
AssertEqual
\ {

View File

@@ -16,7 +16,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The ktlint callback should return the correct default values):
call ale#test#SetFilename('../kotlin_files/testfile.kt')
call ale#test#SetFilename('../test-files/kotlin/testfile.kt')
AssertEqual
\ {
@@ -29,7 +29,7 @@ Execute(The ktlint callback should return the correct default values):
Execute(The ktlint callback should include custom ktlint options):
let g:ale_kotlin_ktlint_options = "--android"
let g:ale_kotlin_ktlint_rulesets = ['/path/to/custom/ruleset.jar']
call ale#test#SetFilename('../kotlin_files/testfile.kt')
call ale#test#SetFilename('../test-files/kotlin/testfile.kt')
AssertEqual
\ {

View File

@@ -14,7 +14,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The latexindent callback should return the correct default values):
call ale#test#SetFilename('../tex_files/testfile.tex')
call ale#test#SetFilename('../test-files/tex/testfile.tex')
AssertEqual
\ {
@@ -25,7 +25,7 @@ Execute(The latexindent callback should return the correct default values):
Execute(The latexindent callback should include custom gofmt options):
let g:ale_tex_latexindent_options = "-l '~/.indentconfig.yaml'"
call ale#test#SetFilename('../tex_files/testfile.tex')
call ale#test#SetFilename('../test-files/tex/testfile.tex')
AssertEqual
\ {

View File

@@ -14,7 +14,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The luafmt callback should return the correct default values):
call ale#test#SetFilename('../lua_files/testfile.lua')
call ale#test#SetFilename('../test-files/lua/testfile.lua')
AssertEqual
\ {
@@ -24,7 +24,7 @@ Execute(The luafmt callback should return the correct default values):
Execute(The luafmt callback should include custom luafmt options):
let g:ale_lua_luafmt_options = "--skip-children"
call ale#test#SetFilename('../lua_files/testfile.lua')
call ale#test#SetFilename('../test-files/lua/testfile.lua')
AssertEqual
\ {

View File

@@ -13,7 +13,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The mix_format callback should return the correct default values):
call ale#test#SetFilename('../elixir-test-files/testfile.ex')
call ale#test#SetFilename('../test-files/elixir/testfile.ex')
AssertEqual
\ {
@@ -25,7 +25,7 @@ Execute(The mix_format callback should return the correct default values):
Execute(The mix_format callback should include the correct format options):
let g:ale_elixir_mix_format_options = 'invalid_options'
call ale#test#SetFilename('../elixir-test-files/testfile.ex')
call ale#test#SetFilename('../test-files/elixir/testfile.ex')
AssertEqual
\ {

View File

@@ -14,7 +14,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The ocamlformat callback should return the correct default values):
call ale#test#SetFilename('../ocaml-test-files/testfile.re')
call ale#test#SetFilename('../test-files/ocaml/testfile.re')
AssertEqual
\ {
@@ -25,7 +25,7 @@ Execute(The ocamlformat callback should return the correct default values):
Execute(The ocamlformat callback should include custom ocamlformat options):
let g:ale_ocaml_ocamlformat_options = "-m 78"
call ale#test#SetFilename('../ocaml-test-files/testfile.re')
call ale#test#SetFilename('../test-files/ocaml/testfile.re')
AssertEqual
\ {

View File

@@ -14,7 +14,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The ocp_indent callback should return the correct default values):
call ale#test#SetFilename('../ocaml-test-files/ocp_inden_testfile.re')
call ale#test#SetFilename('../test-files/ocaml/ocp_inden_testfile.re')
AssertEqual
\ {
@@ -24,7 +24,7 @@ Execute(The ocp_indent callback should return the correct default values):
Execute(The ocp_indent callback should include custom ocp_indent options):
let g:ale_ocaml_ocp_indent_config = "base=4, type=4"
call ale#test#SetFilename('../ocaml-test-files/ocp_inden_testfile.re')
call ale#test#SetFilename('../test-files/ocaml/ocp_inden_testfile.re')
AssertEqual
\ {

View File

@@ -16,22 +16,22 @@ After:
Execute(project with php-cs-fixer should use local by default):
call ale#test#SetFilename('php_paths/project-with-php-cs-fixer/test.php')
call ale#test#SetFilename('../test-files/php/project-with-php-cs-fixer/test.php')
AssertEqual
\ ale#path#Simplify(g:dir . '/php_paths/project-with-php-cs-fixer/vendor/bin/php-cs-fixer'),
\ ale#path#Simplify(g:dir . '/../test-files/php/project-with-php-cs-fixer/vendor/bin/php-cs-fixer'),
\ ale#fixers#php_cs_fixer#GetExecutable(bufnr(''))
Execute(use-global should override local detection):
let g:ale_php_cs_fixer_use_global = 1
call ale#test#SetFilename('php_paths/project-with-php-cs-fixer/test.php')
call ale#test#SetFilename('../test-files/php/project-with-php-cs-fixer/test.php')
AssertEqual
\ 'php-cs-fixer',
\ ale#fixers#php_cs_fixer#GetExecutable(bufnr(''))
Execute(project without php-cs-fixer should use global):
call ale#test#SetFilename('php_paths/project-without-php-cs-fixer/test.php')
call ale#test#SetFilename('../test-files/php/project-without-php-cs-fixer/test.php')
AssertEqual
\ 'php-cs-fixer',
@@ -41,7 +41,7 @@ Execute(project without php-cs-fixer should use global):
Execute(The php-cs-fixer callback should return the correct default values):
call ale#test#SetFilename('php_paths/project-without-php-cs-fixer/foo/test.php')
call ale#test#SetFilename('../test-files/php/project-without-php-cs-fixer/foo/test.php')
AssertEqual
\ {
@@ -54,7 +54,7 @@ Execute(The php-cs-fixer callback should return the correct default values):
Execute(The php-cs-fixer callback should include custom php-cs-fixer options):
let g:ale_php_cs_fixer_options = '--config="$HOME/.php_cs"'
call ale#test#SetFilename('php_paths/project-without-php-cs-fixer/test.php')
call ale#test#SetFilename('../test-files/php/project-without-php-cs-fixer/test.php')
AssertEqual
\ {

View File

@@ -19,48 +19,48 @@ After:
call ale#test#RestoreDirectory()
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('../test-files/php/project-with-phpcbf/foo/test.php')
AssertEqual
\ ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf'),
\ ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf'),
\ ale#fixers#phpcbf#GetExecutable(bufnr(''))
Execute(use-global should override local detection):
let g:ale_php_phpcbf_use_global = 1
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
AssertEqual
\ 'phpcbf_test',
\ ale#fixers#phpcbf#GetExecutable(bufnr(''))
Execute(project without phpcbf should use global):
call ale#test#SetFilename('php_paths/project-without-phpcbf/foo/test.php')
call ale#test#SetFilename('../test-files/php/project-without-phpcbf/foo/test.php')
AssertEqual
\ 'phpcbf_test',
\ ale#fixers#phpcbf#GetExecutable(bufnr(''))
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('../test-files/php/project-with-phpcbf/foo/test.php')
AssertEqual
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
\ ale#fixers#phpcbf#Fix(bufnr(''))
Execute(The phpcbf callback should include the phpcbf_standard option):
let g:ale_php_phpcbf_standard = 'phpcbf_ruleset.xml'
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
AssertEqual
\ {'command': ale#Escape(ale#path#Simplify(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 . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
\ ale#fixers#phpcbf#Fix(bufnr(''))
Execute(User provided options should be used):
let g:ale_php_phpcbf_options = '--my-user-provided-option my-value'
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
AssertEqual
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . ale#Pad('--my-user-provided-option my-value') . ' -'},
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . ale#Pad('--my-user-provided-option my-value') . ' -'},
\ ale#fixers#phpcbf#Fix(bufnr(''))
@@ -85,39 +85,39 @@ After:
call ale#test#RestoreDirectory()
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('../test-files/php/project-with-phpcbf/foo/test.php')
AssertEqual
\ ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf'),
\ ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf'),
\ ale#fixers#phpcbf#GetExecutable(bufnr(''))
Execute(use-global should override local detection):
let g:ale_php_phpcbf_use_global = 1
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
AssertEqual
\ 'phpcbf_test',
\ ale#fixers#phpcbf#GetExecutable(bufnr(''))
Execute(project without phpcbf should use global):
call ale#test#SetFilename('php_paths/project-without-phpcbf/foo/test.php')
call ale#test#SetFilename('../test-files/php/project-without-phpcbf/foo/test.php')
AssertEqual
\ 'phpcbf_test',
\ ale#fixers#phpcbf#GetExecutable(bufnr(''))
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('../test-files/php/project-with-phpcbf/foo/test.php')
AssertEqual
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/php_paths/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
\ {'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s -' },
\ ale#fixers#phpcbf#Fix(bufnr(''))
Execute(The phpcbf callback should include the phpcbf_standard option):
let g:ale_php_phpcbf_standard = 'phpcbf_ruleset.xml'
call ale#test#SetFilename('php_paths/project-with-phpcbf/foo/test.php')
call ale#test#SetFilename('../test-files/php/project-with-phpcbf/foo/test.php')
AssertEqual
\ {'command': ale#Escape(ale#path#Simplify(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 . '/../test-files/php/project-with-phpcbf/vendor/bin/phpcbf')) . ' --stdin-path=%s ' . '--standard=phpcbf_ruleset.xml' . ' -'},
\ ale#fixers#phpcbf#Fix(bufnr(''))

View File

@@ -30,7 +30,7 @@ Execute(Additional options should be used when set):
\ }
Execute(--eslint-config-path should be set for 4.2.0 and up):
call ale#test#SetFilename('eslint-test-files/react-app/foo/bar.js')
call ale#test#SetFilename('../test-files/eslint/react-app/foo/bar.js')
GivenCommandOutput ['4.2.0']
AssertFixer
@@ -39,12 +39,12 @@ Execute(--eslint-config-path should be set for 4.2.0 and up):
\ 'command':
\ ale#Escape('prettier-eslint')
\ . ' %t'
\ . ' --eslint-config-path ' . ale#Escape(ale#path#Simplify(g:dir . '/eslint-test-files/react-app/.eslintrc.js'))
\ . ' --eslint-config-path ' . ale#Escape(ale#test#GetFilename('../test-files/eslint/react-app/.eslintrc.js'))
\ . ' --write'
\ }
Execute(--eslint-config-path shouldn't be used for older versions):
call ale#test#SetFilename('eslint-test-files/react-app/foo/bar.js')
call ale#test#SetFilename('../test-files/eslint/react-app/foo/bar.js')
AssertFixer
\ {
@@ -68,14 +68,14 @@ Execute(The version check should be correct):
\]
Execute(The new --stdin-filepath option should be used when the version is new enough):
call ale#test#SetFilename('eslint-test-files/react-app/foo/bar.js')
call ale#test#SetFilename('../test-files/eslint/react-app/foo/bar.js')
GivenCommandOutput ['4.4.0']
AssertFixer
\ {
\ 'cwd': '%s:h',
\ 'command': ale#Escape('prettier-eslint')
\ . ' --eslint-config-path ' . ale#Escape(ale#path#Simplify(g:dir . '/eslint-test-files/react-app/.eslintrc.js'))
\ . ' --eslint-config-path ' . ale#Escape(ale#test#GetFilename('../test-files/eslint/react-app/.eslintrc.js'))
\ . ' --stdin-filepath %s --stdin',
\ }

View File

@@ -12,7 +12,7 @@ After:
call ale#assert#TearDownFixerTest()
Execute(The prettier callback should return the correct default values):
call ale#test#SetFilename('../prettier-test-files/testfile.js')
call ale#test#SetFilename('../test-files/prettier/testfile.js')
AssertFixer
\ {
@@ -24,7 +24,7 @@ Execute(The prettier callback should return the correct default values):
Execute(The --config option should not be set automatically):
let g:ale_javascript_prettier_use_local_config = 1
call ale#test#SetFilename('../prettier-test-files/with_config/testfile.js')
call ale#test#SetFilename('../test-files/prettier/with_config/testfile.js')
AssertFixer
\ {
@@ -36,7 +36,7 @@ Execute(The --config option should not be set automatically):
Execute(The prettier callback should include custom prettier options):
let g:ale_javascript_prettier_options = '--no-semi'
call ale#test#SetFilename('../prettier-test-files/with_config/testfile.js')
call ale#test#SetFilename('../test-files/prettier/with_config/testfile.js')
AssertFixer
\ {
@@ -48,7 +48,7 @@ Execute(The prettier callback should include custom prettier options):
\ }
Execute(The version check should be correct):
call ale#test#SetFilename('../prettier-test-files/testfile.js')
call ale#test#SetFilename('../test-files/prettier/testfile.js')
AssertFixer [
\ ale#Escape('prettier') . ' --version',
@@ -57,7 +57,7 @@ Execute(The version check should be correct):
Execute(--stdin-filepath should be used when prettier is new enough):
let g:ale_javascript_prettier_options = '--no-semi'
call ale#test#SetFilename('../prettier-test-files/with_config/testfile.js')
call ale#test#SetFilename('../test-files/prettier/with_config/testfile.js')
GivenCommandOutput ['1.6.0']
AssertFixer
@@ -69,7 +69,7 @@ Execute(--stdin-filepath should be used when prettier is new enough):
\ }
Execute(The version number should be cached):
call ale#test#SetFilename('../prettier-test-files/with_config/testfile.js')
call ale#test#SetFilename('../test-files/prettier/with_config/testfile.js')
GivenCommandOutput ['1.6.0']
AssertFixer
@@ -88,7 +88,7 @@ Execute(The version number should be cached):
\ }
Execute(Should set --parser to `babylon` by default, < 1.16.0):
call ale#test#SetFilename('../prettier-test-files/testfile')
call ale#test#SetFilename('../test-files/prettier/testfile')
set filetype=javascript
@@ -102,7 +102,7 @@ Execute(Should set --parser to `babylon` by default, < 1.16.0):
\ }
Execute(Should set --parser to `babel` by default, >= 1.16.0):
call ale#test#SetFilename('../prettier-test-files/testfile')
call ale#test#SetFilename('../test-files/prettier/testfile')
set filetype=javascript
@@ -116,7 +116,7 @@ Execute(Should set --parser to `babel` by default, >= 1.16.0):
\ }
Execute(Should set --parser based on filetype, TypeScript):
call ale#test#SetFilename('../prettier-test-files/testfile')
call ale#test#SetFilename('../test-files/prettier/testfile')
set filetype=typescript
@@ -130,7 +130,7 @@ Execute(Should set --parser based on filetype, TypeScript):
\ }
Execute(Should set --parser based on filetype, CSS):
call ale#test#SetFilename('../prettier-test-files/testfile')
call ale#test#SetFilename('../test-files/prettier/testfile')
set filetype=css
@@ -144,7 +144,7 @@ Execute(Should set --parser based on filetype, CSS):
\ }
Execute(Should set --parser based on filetype, LESS):
call ale#test#SetFilename('../prettier-test-files/testfile')
call ale#test#SetFilename('../test-files/prettier/testfile')
set filetype=less
@@ -158,7 +158,7 @@ Execute(Should set --parser based on filetype, LESS):
\ }
Execute(Should set --parser based on filetype, SCSS):
call ale#test#SetFilename('../prettier-test-files/testfile')
call ale#test#SetFilename('../test-files/prettier/testfile')
set filetype=scss
@@ -172,7 +172,7 @@ Execute(Should set --parser based on filetype, SCSS):
\ }
Execute(Should set --parser based on filetype, JSON):
call ale#test#SetFilename('../prettier-test-files/testfile')
call ale#test#SetFilename('../test-files/prettier/testfile')
set filetype=json
@@ -186,7 +186,7 @@ Execute(Should set --parser based on filetype, JSON):
\ }
Execute(Should set --parser based on filetype, JSON5):
call ale#test#SetFilename('../prettier-test-files/testfile')
call ale#test#SetFilename('../test-files/prettier/testfile')
set filetype=json5
@@ -200,7 +200,7 @@ Execute(Should set --parser based on filetype, JSON5):
\ }
Execute(Should set --parser based on filetype, GraphQL):
call ale#test#SetFilename('../prettier-test-files/testfile')
call ale#test#SetFilename('../test-files/prettier/testfile')
set filetype=graphql
@@ -214,7 +214,7 @@ Execute(Should set --parser based on filetype, GraphQL):
\ }
Execute(Should set --parser based on filetype, Markdown):
call ale#test#SetFilename('../prettier-test-files/testfile')
call ale#test#SetFilename('../test-files/prettier/testfile')
set filetype=markdown
@@ -228,7 +228,7 @@ Execute(Should set --parser based on filetype, Markdown):
\ }
Execute(Should set --parser based on filetype, Vue):
call ale#test#SetFilename('../prettier-test-files/testfile')
call ale#test#SetFilename('../test-files/prettier/testfile')
set filetype=vue
@@ -242,7 +242,7 @@ Execute(Should set --parser based on filetype, Vue):
\ }
Execute(Should set --parser based on filetype, YAML):
call ale#test#SetFilename('../prettier-test-files/testfile')
call ale#test#SetFilename('../test-files/prettier/testfile')
set filetype=yaml
@@ -256,7 +256,7 @@ Execute(Should set --parser based on filetype, YAML):
\ }
Execute(Should set --parser based on filetype, HTML):
call ale#test#SetFilename('../prettier-test-files/testfile')
call ale#test#SetFilename('../test-files/prettier/testfile')
set filetype=html
@@ -270,7 +270,7 @@ Execute(Should set --parser based on filetype, HTML):
\ }
Execute(Should set --parser based on filetype, Ruby):
call ale#test#SetFilename('../prettier-test-files/testfile')
call ale#test#SetFilename('../test-files/prettier/testfile')
set filetype=ruby
@@ -284,7 +284,7 @@ Execute(Should set --parser based on filetype, Ruby):
\ }
Execute(Should set --parser based on first filetype of multiple filetypes):
call ale#test#SetFilename('../prettier-test-files/testfile')
call ale#test#SetFilename('../test-files/prettier/testfile')
set filetype=css.scss
@@ -298,7 +298,7 @@ Execute(Should set --parser based on first filetype of multiple filetypes):
\ }
Execute(Should set --parser for experimental language, Handlebars):
call ale#test#SetFilename('../prettier-test-files/testfile.hbs')
call ale#test#SetFilename('../test-files/prettier/testfile.hbs')
set filetype=html.handlebars
@@ -312,7 +312,7 @@ Execute(Should set --parser for experimental language, Handlebars):
\ }
Execute(Changes to directory where .prettierignore is found):
call ale#test#SetFilename('../prettier-test-files/with_prettierignore/src/testfile.js')
call ale#test#SetFilename('../test-files/prettier/with_prettierignore/src/testfile.js')
GivenCommandOutput ['1.6.0']
AssertFixer

View File

@@ -9,7 +9,7 @@ After:
call ale#assert#TearDownFixerTest()
Execute(The prettier callback should return the correct default values):
call ale#test#SetFilename('../prettier-test-files/testfile.js')
call ale#test#SetFilename('../test-files/prettier/testfile.js')
AssertFixer
\ {

View File

@@ -17,7 +17,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The puppetlint callback should return the correct default values):
silent execute 'file ' . fnameescape(g:dir . '/puppet_paths/dummy.pp')
silent execute 'file ' . fnameescape(g:dir . '/../test-files/puppet/dummy.pp')
AssertEqual
\ {'read_temporary_file': 1,

View File

@@ -14,7 +14,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The refmt callback should return the correct default values):
call ale#test#SetFilename('../reasonml_files/testfile.re')
call ale#test#SetFilename('../test-files/reasonml/testfile.re')
AssertEqual
\ {
@@ -27,7 +27,7 @@ Execute(The refmt callback should return the correct default values):
Execute(The refmt callback should include custom refmt options):
let g:ale_reasonml_refmt_options = "-w 80"
call ale#test#SetFilename('../reasonml_files/testfile.re')
call ale#test#SetFilename('../test-files/reasonml/testfile.re')
AssertEqual
\ {

View File

@@ -25,10 +25,10 @@ Execute(The reorder_python_imports callback should return the correct default va
\ 0,
\ ale#fixers#reorder_python_imports#Fix(bufnr(''))
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
AssertEqual
\ {
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/'
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/'
\ . b:bin_dir . '/reorder-python-imports')) . ' -',
\ },
\ ale#fixers#reorder_python_imports#Fix(bufnr(''))
@@ -40,10 +40,10 @@ Execute(The reorder_python_imports callback should respect custom options):
\ 0,
\ ale#fixers#reorder_python_imports#Fix(bufnr(''))
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.py')
AssertEqual
\ {
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/'
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/'
\ . b:bin_dir . '/reorder-python-imports')) . ' --py3-plus -',
\ },
\ ale#fixers#reorder_python_imports#Fix(bufnr(''))

View File

@@ -17,7 +17,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The rubocop callback should return the correct default values):
call ale#test#SetFilename('ruby_paths/dummy.rb')
call ale#test#SetFilename('../test-files/ruby/dummy.rb')
AssertEqual
\ {
@@ -28,26 +28,26 @@ Execute(The rubocop callback should return the correct default values):
\ ale#fixers#rubocop#Fix(bufnr(''))
Execute(The rubocop callback should include configuration files):
call ale#test#SetFilename('ruby_paths/with_config/dummy.rb')
call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
AssertEqual
\ {
\ 'process_with': 'ale#fixers#rubocop#PostProcess',
\ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
\ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/ruby_paths/with_config/.rubocop.yml'))
\ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ruby/with_config/.rubocop.yml'))
\ . ' --auto-correct --force-exclusion --stdin %s',
\ },
\ ale#fixers#rubocop#Fix(bufnr(''))
Execute(The rubocop callback should include custom rubocop options):
let g:ale_ruby_rubocop_options = '--except Lint/Debugger'
call ale#test#SetFilename('ruby_paths/with_config/dummy.rb')
call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
AssertEqual
\ {
\ 'process_with': 'ale#fixers#rubocop#PostProcess',
\ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
\ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/ruby_paths/with_config/.rubocop.yml'))
\ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ruby/with_config/.rubocop.yml'))
\ . ' --except Lint/Debugger'
\ . ' --auto-correct --force-exclusion --stdin %s',
\ },
@@ -55,13 +55,13 @@ Execute(The rubocop callback should include custom rubocop options):
Execute(The rubocop callback should use auto-correct-all option when set):
let g:ale_ruby_rubocop_auto_correct_all = 1
call ale#test#SetFilename('ruby_paths/with_config/dummy.rb')
call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
AssertEqual
\ {
\ 'process_with': 'ale#fixers#rubocop#PostProcess',
\ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
\ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/ruby_paths/with_config/.rubocop.yml'))
\ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ruby/with_config/.rubocop.yml'))
\ . ' --auto-correct-all --force-exclusion --stdin %s'
\ },
\ ale#fixers#rubocop#Fix(bufnr(''))

View File

@@ -14,14 +14,14 @@ After:
Execute(The rufo command should contain `bundle exec` when executable is `bundle`):
let g:ale_ruby_rufo_executable = 'bundle'
call ale#test#SetFilename('ruby_paths/dummy.rb')
call ale#test#SetFilename('../test-files/ruby/dummy.rb')
AssertEqual
\ ale#Escape('bundle') . ' exec rufo %t',
\ ale#fixers#rufo#GetCommand(bufnr(''))
Execute(The rufo callback should return the correct default values):
call ale#test#SetFilename('ruby_paths/dummy.rb')
call ale#test#SetFilename('../test-files/ruby/dummy.rb')
AssertEqual
\ {

View File

@@ -1,34 +1,16 @@
Before:
Save g:ale_rust_rustfmt_executable
Save g:ale_rust_rustfmt_options
" Use an invalid global executable, so we don't match it.
let g:ale_rust_rustfmt_executable = 'xxxinvalid'
let g:ale_rust_rustfmt_options = ''
call ale#test#SetDirectory('/testplugin/test/fixers')
call ale#assert#SetUpFixerTest('rust', 'rustfmt')
After:
Restore
call ale#test#RestoreDirectory()
call ale#assert#TearDownFixerTest()
Execute(The rustfmt callback should return the correct default values):
call ale#test#SetFilename('../rust_files/testfile.rs')
call ale#test#SetFilename('../test-files/rust/testfile.rs')
AssertEqual
\ {
\ 'command': ale#Escape('xxxinvalid'),
\ },
\ ale#fixers#rustfmt#Fix(bufnr(''))
AssertFixer {'command': ale#Escape('rustfmt')}
Execute(The rustfmt callback should include custom rustfmt options):
let g:ale_rust_rustfmt_options = "--skip-children"
call ale#test#SetFilename('../rust_files/testfile.rs')
call ale#test#SetFilename('../test-files/rust/testfile.rs')
AssertEqual
\ {
\ 'command': ale#Escape('xxxinvalid')
\ . ' ' . g:ale_rust_rustfmt_options,
\ },
\ ale#fixers#rustfmt#Fix(bufnr(''))
AssertFixer {'command': ale#Escape('rustfmt') . ' ' . g:ale_rust_rustfmt_options}

View File

@@ -17,7 +17,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The scalafmt callback should return the correct default values):
call ale#test#SetFilename('scala_paths/dummy.scala')
call ale#test#SetFilename('../test-files/scala/dummy.scala')
AssertEqual
\ {
@@ -29,7 +29,7 @@ Execute(The scalafmt callback should return the correct default values):
Execute(The scalafmt callback should use ng with scalafmt automatically):
let g:ale_scala_scalafmt_executable = 'ng'
call ale#test#SetFilename('scala_paths/dummy.scala')
call ale#test#SetFilename('../test-files/scala/dummy.scala')
AssertEqual
\ {
@@ -42,7 +42,7 @@ Execute(The scalafmt callback should use ng with scalafmt automatically):
Execute(The scalafmt callback should include custom scalafmt options):
let g:ale_scala_scalafmt_options = '--diff'
call ale#test#SetFilename('scala_paths/dummy.scala')
call ale#test#SetFilename('../test-files/scala/dummy.scala')
AssertEqual
\ {
@@ -56,7 +56,7 @@ Execute(The scalafmt callback should include custom scalafmt options):
Execute(The scalafmt callback should include custom scalafmt options and use ng with scalafmt):
let g:ale_scala_scalafmt_options = '--diff'
let g:ale_scala_scalafmt_executable = 'ng'
call ale#test#SetFilename('scala_paths/dummy.scala')
call ale#test#SetFilename('../test-files/scala/dummy.scala')
AssertEqual
\ {

View File

@@ -18,7 +18,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The sorbet callback should return the correct default values):
call ale#test#SetFilename('ruby_paths/dummy.rb')
call ale#test#SetFilename('../test-files/ruby/dummy.rb')
AssertEqual
\ {
@@ -30,7 +30,7 @@ Execute(The sorbet callback should return the correct default values):
Execute(The sorbet callback should include custom sorbet options):
let g:ale_ruby_sorbet_options = '--enable-experimental-lsp-hover'
call ale#test#SetFilename('ruby_paths/with_config/dummy.rb')
call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
AssertEqual
\ {

View File

@@ -8,13 +8,13 @@ After:
call ale#test#RestoreDirectory()
Execute(The executable path should be correct):
call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.js')
call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.js')
AssertEqual
\ {
\ 'read_temporary_file': 1,
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/standard/bin/cmd.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/standard/bin/cmd.js'))
\ . ' --fix --stdin < %s > %t',
\ },
\ ale#fixers#standard#Fix(bufnr(''))

View File

@@ -17,7 +17,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The standardrb callback should return the correct default values):
call ale#test#SetFilename('ruby_paths/dummy.rb')
call ale#test#SetFilename('../test-files/ruby/dummy.rb')
AssertEqual
\ {
@@ -28,26 +28,26 @@ Execute(The standardrb callback should return the correct default values):
\ ale#fixers#standardrb#Fix(bufnr(''))
Execute(The standardrb callback should include configuration files):
call ale#test#SetFilename('ruby_paths/with_config/dummy.rb')
call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
AssertEqual
\ {
\ 'process_with': 'ale#fixers#rubocop#PostProcess',
\ 'command': ale#Escape(g:ale_ruby_standardrb_executable)
\ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/ruby_paths/with_config/.standard.yml'))
\ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ruby/with_config/.standard.yml'))
\ . ' --fix --force-exclusion --stdin %s',
\ },
\ ale#fixers#standardrb#Fix(bufnr(''))
Execute(The standardrb callback should include custom rubocop options):
let g:ale_ruby_standardrb_options = '--except Lint/Debugger'
call ale#test#SetFilename('ruby_paths/with_config/dummy.rb')
call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
AssertEqual
\ {
\ 'process_with': 'ale#fixers#rubocop#PostProcess',
\ 'command': ale#Escape(g:ale_ruby_standardrb_executable)
\ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/ruby_paths/with_config/.standard.yml'))
\ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ruby/with_config/.standard.yml'))
\ . ' --except Lint/Debugger'
\ . ' --fix --force-exclusion --stdin %s',
\ },

View File

@@ -9,28 +9,28 @@ After:
call ale#assert#TearDownFixerTest()
Execute(The stylelint callback should return the correct default values):
call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.css')
call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.css')
AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'cwd': '%s:h',
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/stylelint/bin/stylelint.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/stylelint/bin/stylelint.js'))
\ . ' %t'
\ . ' --fix',
\ }
Execute(The stylelint callback should include custom stylelint options):
let g:ale_stylelint_options = '--cache'
call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.css')
call ale#test#SetFilename('../test-files/eslint/react-app/subdir/testfile.css')
AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'cwd': '%s:h',
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/stylelint/bin/stylelint.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/eslint/react-app/node_modules/stylelint/bin/stylelint.js'))
\ . ' %t'
\ . ' --cache'
\ . ' --fix',

View File

@@ -15,7 +15,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The swiftformat callback should return the correct default values):
call ale#test#SetFilename('swift_paths/dummy.swift')
call ale#test#SetFilename('../test-files/swift/dummy.swift')
AssertEqual
\ {
@@ -26,7 +26,7 @@ Execute(The swiftformat callback should return the correct default values):
\ ale#fixers#swiftformat#Fix(bufnr(''))
Execute(The swiftformat callback should include any additional options):
call ale#test#SetFilename('swift_paths/dummy.swift')
call ale#test#SetFilename('../test-files/swift/dummy.swift')
let g:ale_swift_swiftformat_options = '--some-option'
AssertEqual

View File

@@ -16,7 +16,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The textlint callback should return the correct default values):
call ale#test#SetFilename('../markdown_files/testfile.md')
call ale#test#SetFilename('../test-files/markdown/testfile.md')
AssertEqual
\ {
@@ -29,7 +29,7 @@ Execute(The textlint callback should return the correct default values):
Execute(The textlint callback should include custom textlint options):
let g:ale_textlint_options = "--quiet"
call ale#test#SetFilename('../markdown_files/testfile.md')
call ale#test#SetFilename('../test-files/markdown/testfile.md')
AssertEqual
\ {

View File

@@ -1,7 +1,7 @@
Before:
Save g:ale_html_tidy_executable
let g:ale_html_tidy_executable = 'tidy_paths/tidy'
let g:ale_html_tidy_executable = '../test-files/tidy/tidy'
call ale#test#SetDirectory('/testplugin/test/fixers')
@@ -23,7 +23,7 @@ Execute(The tidy callback should return 0 if tidy not found):
Execute(The tidy callback should return the correct default command):
AssertEqual
\ {
\ 'command': ale#Escape('tidy_paths/tidy')
\ 'command': ale#Escape('../test-files/tidy/tidy')
\ . ' -q --tidy-mark no --show-errors 0 --show-warnings 0'
\ },
\ ale#fixers#tidy#Fix(bufnr(''))

View File

@@ -20,7 +20,7 @@ After:
Execute(The tslint callback should return the correct default values):
let g:ale_typescript_tslint_config_path = 'tslint.json'
call ale#test#SetFilename('../prettier-test-files/testfile.ts')
call ale#test#SetFilename('../test-files/prettier/testfile.ts')
AssertEqual
\ {
@@ -33,7 +33,7 @@ Execute(The tslint callback should return the correct default values):
Execute(The tslint callback should include custom tslint config option):
let g:ale_typescript_tslint_config_path = '.tslintrc'
call ale#test#SetFilename('../prettier-test-files/testfile.ts')
call ale#test#SetFilename('../test-files/prettier/testfile.ts')
AssertEqual
\ {

View File

@@ -15,7 +15,7 @@ After:
call ale#test#RestoreDirectory()
Execute(The clang-format callback should return the correct default values):
call ale#test#SetFilename('c_paths/dummy.c')
call ale#test#SetFilename('../test-files/c/dummy.c')
AssertEqual
\ {
@@ -25,7 +25,7 @@ Execute(The clang-format callback should return the correct default values):
\ ale#fixers#uncrustify#Fix(bufnr(''))
Execute(The uncrustify callback should include any additional options):
call ale#test#SetFilename('c_paths/dummy.c')
call ale#test#SetFilename('../test-files/c/dummy.c')
let b:ale_c_uncrustify_options = '--some-option'
AssertEqual

View File

@@ -7,38 +7,38 @@ After:
call ale#assert#TearDownFixerTest()
Execute(The xo callback should return the correct default values):
call ale#test#SetFilename('../xo-test-files/monorepo/packages/a/index.js')
call ale#test#SetFilename('../test-files/xo/monorepo/packages/a/index.js')
AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../xo-test-files/monorepo/node_modules/xo/cli.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/xo/monorepo/node_modules/xo/cli.js'))
\ . ' --fix %t',
\ }
Execute(The xo callback should include custom xo options):
let g:ale_javascript_xo_options = '--space'
call ale#test#SetFilename('../xo-test-files/monorepo/packages/a/index.js')
call ale#test#SetFilename('../test-files/xo/monorepo/packages/a/index.js')
AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../xo-test-files/monorepo/node_modules/xo/cli.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/xo/monorepo/node_modules/xo/cli.js'))
\ . ' --fix %t'
\ . ' --space',
\ }
Execute(--stdin should be used when xo is new enough):
let g:ale_javascript_xo_options = '--space'
call ale#test#SetFilename('../xo-test-files/monorepo/packages/a/index.js')
call ale#test#SetFilename('../test-files/xo/monorepo/packages/a/index.js')
GivenCommandOutput ['0.30.0']
AssertFixer
\ {
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../xo-test-files/monorepo/node_modules/xo/cli.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/xo/monorepo/node_modules/xo/cli.js'))
\ . ' --stdin --stdin-filename %s'
\ . ' --fix'
\ . ' --space',

View File

@@ -7,38 +7,38 @@ After:
call ale#assert#TearDownFixerTest()
Execute(The xo callback should return the correct default values):
call ale#test#SetFilename('../xo-test-files/monorepo/packages/a/index.ts')
call ale#test#SetFilename('../test-files/xo/monorepo/packages/a/index.ts')
AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../xo-test-files/monorepo/node_modules/xo/cli.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/xo/monorepo/node_modules/xo/cli.js'))
\ . ' --fix %t',
\ }
Execute(The xo callback should include custom xo options):
let g:ale_typescript_xo_options = '--space'
call ale#test#SetFilename('../xo-test-files/monorepo/packages/a/index.ts')
call ale#test#SetFilename('../test-files/xo/monorepo/packages/a/index.ts')
AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../xo-test-files/monorepo/node_modules/xo/cli.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/xo/monorepo/node_modules/xo/cli.js'))
\ . ' --fix %t'
\ . ' --space',
\ }
Execute(--stdin should be used when xo is new enough):
let g:ale_typescript_xo_options = '--space'
call ale#test#SetFilename('../xo-test-files/monorepo/packages/a/index.ts')
call ale#test#SetFilename('../test-files/xo/monorepo/packages/a/index.ts')
GivenCommandOutput ['0.30.0']
AssertFixer
\ {
\ 'command': (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../xo-test-files/monorepo/node_modules/xo/cli.js'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/xo/monorepo/node_modules/xo/cli.js'))
\ . ' --stdin --stdin-filename %s'
\ . ' --fix'
\ . ' --space',

View File

@@ -16,22 +16,22 @@ Execute(The yamlfix callback should return the correct default values):
\ 0,
\ ale#fixers#yamlfix#Fix(bufnr(''))
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.yaml')
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.yaml')
AssertEqual
\ {
\ 'cwd': '%s:h',
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/yamlfix')) . ' -',
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/yamlfix')) . ' -',
\ },
\ ale#fixers#yamlfix#Fix(bufnr(''))
Execute(The yamlfix callback should respect custom options):
let g:ale_yaml_yamlfix_options = '--multi-line=3 --trailing-comma'
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.yaml')
silent execute 'file ' . fnameescape(g:dir . '/../test-files/python/with_virtualenv/subdir/foo/bar.yaml')
AssertEqual
\ {
\ 'cwd': '%s:h',
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/yamlfix'))
\ 'command': ale#Escape(ale#path#Simplify(g:dir . '/../test-files/python/with_virtualenv/env/' . b:bin_dir . '/yamlfix'))
\ . ' --multi-line=3 --trailing-comma -',
\ },
\ ale#fixers#yamlfix#Fix(bufnr(''))

View File

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