summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-10-25 14:24:56 +0100
committerGitHub <noreply@github.com>2018-10-25 14:24:56 +0100
commitb3829d043dec7c35870197eec4b50ab7a14ea1bf (patch)
tree3a51875d88a37de023f62f1ba871bdd4a08c02df /test/fixers
parent68b55912990226003213c25e43a57847ac7f36f1 (diff)
parentd14db50c4404cfdd95a5d3a19e7d6574b69aa2f0 (diff)
downloadale-b3829d043dec7c35870197eec4b50ab7a14ea1bf.zip
Merge pull request #2012 from paihu/fix-cdstring-win32-change-drive
Fix #2011 MS Windows, lint error when current drive and target file drive is different.
Diffstat (limited to 'test/fixers')
-rw-r--r--test/fixers/test_isort_fixer_callback.vader4
-rw-r--r--test/fixers/test_prettier_eslint_fixer.callback.vader4
-rw-r--r--test/fixers/test_prettier_fixer_callback.vader26
3 files changed, 17 insertions, 17 deletions
diff --git a/test/fixers/test_isort_fixer_callback.vader b/test/fixers/test_isort_fixer_callback.vader
index 56c08d26..50818621 100644
--- a/test/fixers/test_isort_fixer_callback.vader
+++ b/test/fixers/test_isort_fixer_callback.vader
@@ -27,7 +27,7 @@ Execute(The isort callback should return the correct default values):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir/foo')) . ' && '
+ \ 'command': ale#path#CdString(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir/foo'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/isort')) . ' -',
\ },
\ ale#fixers#isort#Fix(bufnr(''))
@@ -42,7 +42,7 @@ Execute(The isort callback should respect custom options):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/with_virtualenv/subdir/foo/bar.py')
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir/foo')) . ' && '
+ \ 'command': ale#path#CdString(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/subdir/foo'))
\ . ale#Escape(ale#path#Simplify(g:dir . '/python_paths/with_virtualenv/env/' . b:bin_dir . '/isort'))
\ . ' --multi-line=3 --trailing-comma -',
\ },
diff --git a/test/fixers/test_prettier_eslint_fixer.callback.vader b/test/fixers/test_prettier_eslint_fixer.callback.vader
index ef0b35df..5c899d86 100644
--- a/test/fixers/test_prettier_eslint_fixer.callback.vader
+++ b/test/fixers/test_prettier_eslint_fixer.callback.vader
@@ -85,7 +85,7 @@ Execute(The new --stdin-filepath option should be used when the version is new e
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape('prettier-eslint')
\ . ' --eslint-config-path ' . ale#Escape(ale#path#Simplify(g:dir . '/eslint-test-files/react-app/.eslintrc.js'))
\ . ' --stdin-filepath %s --stdin',
@@ -106,7 +106,7 @@ Execute(The version number should be cached):
" The newer command should be used.
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape('prettier-eslint')
\ . ' --stdin-filepath %s --stdin',
\ },
diff --git a/test/fixers/test_prettier_fixer_callback.vader b/test/fixers/test_prettier_fixer_callback.vader
index 44245630..3697e87c 100644
--- a/test/fixers/test_prettier_fixer_callback.vader
+++ b/test/fixers/test_prettier_fixer_callback.vader
@@ -74,7 +74,7 @@ Execute(--stdin-filepath should be used when prettier is new enough):
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --no-semi'
\ . ' --stdin-filepath %s --stdin',
@@ -90,7 +90,7 @@ Execute(The version number should be cached):
" Call it again without the version output. We should use the newer command.
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --stdin-filepath %s --stdin',
\ },
@@ -103,7 +103,7 @@ Execute(Should set --parser based on filetype, TypeScript):
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser typescript'
\ . ' --stdin-filepath %s --stdin',
@@ -117,7 +117,7 @@ Execute(Should set --parser based on filetype, CSS):
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser css'
\ . ' --stdin-filepath %s --stdin',
@@ -131,7 +131,7 @@ Execute(Should set --parser based on filetype, LESS):
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser less'
\ . ' --stdin-filepath %s --stdin',
@@ -145,7 +145,7 @@ Execute(Should set --parser based on filetype, SCSS):
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser scss'
\ . ' --stdin-filepath %s --stdin',
@@ -159,7 +159,7 @@ Execute(Should set --parser based on filetype, JSON):
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser json'
\ . ' --stdin-filepath %s --stdin',
@@ -173,7 +173,7 @@ Execute(Should set --parser based on filetype, JSON5):
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser json5'
\ . ' --stdin-filepath %s --stdin',
@@ -187,7 +187,7 @@ Execute(Should set --parser based on filetype, GraphQL):
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser graphql'
\ . ' --stdin-filepath %s --stdin',
@@ -201,7 +201,7 @@ Execute(Should set --parser based on filetype, Markdown):
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser markdown'
\ . ' --stdin-filepath %s --stdin',
@@ -215,7 +215,7 @@ Execute(Should set --parser based on filetype, Vue):
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser vue'
\ . ' --stdin-filepath %s --stdin',
@@ -229,7 +229,7 @@ Execute(Should set --parser based on filetype, YAML):
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser yaml'
\ . ' --stdin-filepath %s --stdin',
@@ -243,7 +243,7 @@ Execute(Should set --parser based on first filetype of multiple filetypes):
AssertEqual
\ {
- \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser css'
\ . ' --stdin-filepath %s --stdin',