install.fairie/dotfiles/.vim/plugged/ale/test/fixers/test_xmllint_fixer_callback.vader
Git E2E Dev Test Username e149692cc9 git subrepo clone https://github.com/dense-analysis/ale.git ./dotfiles/.vim/plugged/ale
subrepo:
  subdir:   "dotfiles/.vim/plugged/ale"
  merged:   "e4b205440"
upstream:
  origin:   "https://github.com/dense-analysis/ale.git"
  branch:   "master"
  commit:   "e4b205440"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:37:09 -04:00

46 lines
1.2 KiB
Text

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(''))