diff options
author | Bjorn Neergaard <bjorn@neersighted.com> | 2018-11-29 14:57:35 -0700 |
---|---|---|
committer | Bjorn Neergaard <bjorn@neersighted.com> | 2018-11-29 14:57:35 -0700 |
commit | d2b0ae8108b2ee395d4eb43c49d68b322a023a30 (patch) | |
tree | bb8145e69bf1bcb8968b29cb1a68c47ceb83674d /test/fixers/test_xmllint_fixer_callback.vader | |
parent | ef641dda80f45cb979bc93c2513c6e10cbd8e42a (diff) | |
parent | 0a384a49d371838903d8401c5358ec60f3f4266d (diff) | |
download | ale-d2b0ae8108b2ee395d4eb43c49d68b322a023a30.zip |
Merge branch 'master' into sridhars
Diffstat (limited to 'test/fixers/test_xmllint_fixer_callback.vader')
-rw-r--r-- | test/fixers/test_xmllint_fixer_callback.vader | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/fixers/test_xmllint_fixer_callback.vader b/test/fixers/test_xmllint_fixer_callback.vader new file mode 100644 index 00000000..54fe05bd --- /dev/null +++ b/test/fixers/test_xmllint_fixer_callback.vader @@ -0,0 +1,46 @@ +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): + AssertEqual + \ { + \ 'command': ale#Escape('/path/to/xmllint') + \ . ' --format ' + \ . ale#Escape(bufname(bufnr(''))) + \ }, + \ ale#fixers#xmllint#Fix(bufnr('')) + +Execute(The xmllint callback should include the XMLLINT_INDENT variable): + let g:ale_xml_xmllint_indentsize = 2 + + AssertEqual + \ { + \ 'command': ale#Env('XMLLINT_INDENT', ' ') + \ . ale#Escape('/path/to/xmllint') + \ . ' --format ' + \ . ale#Escape(bufname(bufnr(''))) + \ }, + \ ale#fixers#xmllint#Fix(bufnr('')) + +Execute(The xmllint callback should include additional options): + let g:ale_xml_xmllint_options = '--nonet' + + AssertEqual + \ { + \ 'command': ale#Escape('/path/to/xmllint') + \ . ' --format ' + \ . ale#Escape(bufname(bufnr(''))) + \ . ' --nonet' + \ }, + \ ale#fixers#xmllint#Fix(bufnr('')) |