X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/0ee596c5c5e11fc79598407eaf22f83d279f7e9e..5a4872f466ebd76ddd532bdf2798554421c53df4:/.vim/bundle/ale/test/fixers/test_xmllint_fixer_callback.vader diff --git a/.vim/bundle/ale/test/fixers/test_xmllint_fixer_callback.vader b/.vim/bundle/ale/test/fixers/test_xmllint_fixer_callback.vader new file mode 100644 index 00000000..392c982e --- /dev/null +++ b/.vim/bundle/ale/test/fixers/test_xmllint_fixer_callback.vader @@ -0,0 +1,56 @@ +Before: + Save g:ale_xml_xmllint_executable + Save g:ale_xml_xmllint_indentsize + Save g:ale_xml_xmllint_options + + let g:ale_xml_xmllint_executable = '/path/to/xmllint' + let g:ale_xml_xmllint_indentsize = '' + let g:ale_xml_xmllint_options = '' + + call ale#test#SetDirectory('/testplugin/test/fixers') + +After: + Restore + +Execute(The xmllint callback should return the correct default command with unpersisted buffer): + new + + AssertEqual + \ { + \ 'command': ale#Escape('/path/to/xmllint') + \ . ' --format -' + \ }, + \ ale#fixers#xmllint#Fix(bufnr('')) + +Execute(The xmllint callback should return the correct default command): + call ale#test#SetFilename('../test-files/xml/dummy.xml') + + AssertEqual + \ { + \ 'command': ale#Escape('/path/to/xmllint') + \ . ' --format -' + \ }, + \ ale#fixers#xmllint#Fix(bufnr('')) + +Execute(The xmllint callback should include the XMLLINT_INDENT variable): + call ale#test#SetFilename('../test-files/xml/dummy.xml') + let g:ale_xml_xmllint_indentsize = 2 + + AssertEqual + \ { + \ 'command': ale#Env('XMLLINT_INDENT', ' ') + \ . ale#Escape('/path/to/xmllint') + \ . ' --format -' + \ }, + \ ale#fixers#xmllint#Fix(bufnr('')) + +Execute(The xmllint callback should include additional options): + call ale#test#SetFilename('../test-files/xml/dummy.xml') + let g:ale_xml_xmllint_options = '--nonet --custom-opt 2' + + AssertEqual + \ { + \ 'command': ale#Escape('/path/to/xmllint') + \ . ' --format --nonet --custom-opt 2 -' + \ }, + \ ale#fixers#xmllint#Fix(bufnr(''))