Fix the JSON fixer post-processor test harder on Windows

This commit is contained in:
w0rp 2017-11-22 23:45:51 +00:00
parent 5160f814d9
commit f99b027cc6

View File

@ -148,15 +148,20 @@ Before:
let l:ProcessWith = {buffer, output -> JSONPostProcessor(buffer, output)} let l:ProcessWith = {buffer, output -> JSONPostProcessor(buffer, output)}
endif endif
" Escaping needs to be handled specially for CMD on Windows.
let l:json_string = has('win32')
\ ? '{"output":["x","y","z"]}'
\ : ale#Escape('{"output": ["x", "y", "z"]}')
return { return {
\ 'command': 'echo ' . ale#Escape('{"output": ["x", "y", "z"]}'), \ 'command': 'echo ' . l:json_string,
\ 'read_buffer': 0, \ 'read_buffer': 0,
\ 'process_with': l:ProcessWith, \ 'process_with': l:ProcessWith,
\} \}
endfunction endfunction
function! JSONPostProcessor(buffer, output) abort function! JSONPostProcessor(buffer, output) abort
return json_decode(join(split(a:output[0]))).output return json_decode(a:output[0]).output
endfunction endfunction
After: After: