mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-09 04:52:29 +08:00
Add fixer tidy for HTML
Add tests for tidy HTML fixer
This commit is contained in:
0
test/command_callback/tidy_paths/.tidyrc
Normal file
0
test/command_callback/tidy_paths/.tidyrc
Normal file
0
test/command_callback/tidy_paths/test.html
Normal file
0
test/command_callback/tidy_paths/test.html
Normal file
0
test/command_callback/tidy_paths/tidy
Executable file
0
test/command_callback/tidy_paths/tidy
Executable file
0
test/command_callback/tidy_paths/tidy.exe
Executable file
0
test/command_callback/tidy_paths/tidy.exe
Executable file
29
test/fixers/test_tidy_fixer_callback.vader
Normal file
29
test/fixers/test_tidy_fixer_callback.vader
Normal file
@@ -0,0 +1,29 @@
|
||||
Before:
|
||||
Save g:ale_html_tidy_executable
|
||||
|
||||
let g:ale_html_tidy_executable = 'tidy_paths/tidy'
|
||||
|
||||
call ale#test#SetDirectory('/testplugin/test/fixers')
|
||||
|
||||
silent cd ..
|
||||
silent cd command_callback
|
||||
let g:dir = getcwd()
|
||||
|
||||
After:
|
||||
Restore
|
||||
|
||||
call ale#test#RestoreDirectory()
|
||||
|
||||
Execute(The tidy callback should return 0 if tidy not found):
|
||||
let g:ale_html_tidy_executable = 'xxxinvalidpath'
|
||||
AssertEqual
|
||||
\ 0,
|
||||
\ ale#fixers#tidy#Fix(bufnr(''))
|
||||
|
||||
Execute(The tidy callback should return the correct default command):
|
||||
AssertEqual
|
||||
\ {
|
||||
\ 'command': ale#Escape('tidy_paths/tidy')
|
||||
\ . ' -q --tidy-mark no --show-errors 0 --show-warnings 0'
|
||||
\ },
|
||||
\ ale#fixers#tidy#Fix(bufnr(''))
|
||||
Reference in New Issue
Block a user