summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAbin Simon <abinsimon10@gmail.com>2018-06-23 15:40:28 +0530
committerAbin Simon <abinsimon10@gmail.com>2018-06-23 22:59:13 +0530
commit17c1aefb5bdd58ff854f17e00aa949e841560e94 (patch)
treef79622a2cedd178cf4c7e749dfddd7cbd4137e4a /test
parent935740cf9310f52c60a67b33cfcd74f0140d95b8 (diff)
downloadale-17c1aefb5bdd58ff854f17e00aa949e841560e94.zip
Add fixer tidy for HTML
Add tests for tidy HTML fixer
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/tidy_paths/.tidyrc0
-rw-r--r--test/command_callback/tidy_paths/test.html0
-rwxr-xr-xtest/command_callback/tidy_paths/tidy0
-rwxr-xr-xtest/command_callback/tidy_paths/tidy.exe0
-rw-r--r--test/fixers/test_tidy_fixer_callback.vader29
5 files changed, 29 insertions, 0 deletions
diff --git a/test/command_callback/tidy_paths/.tidyrc b/test/command_callback/tidy_paths/.tidyrc
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/tidy_paths/.tidyrc
diff --git a/test/command_callback/tidy_paths/test.html b/test/command_callback/tidy_paths/test.html
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/tidy_paths/test.html
diff --git a/test/command_callback/tidy_paths/tidy b/test/command_callback/tidy_paths/tidy
new file mode 100755
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/tidy_paths/tidy
diff --git a/test/command_callback/tidy_paths/tidy.exe b/test/command_callback/tidy_paths/tidy.exe
new file mode 100755
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/tidy_paths/tidy.exe
diff --git a/test/fixers/test_tidy_fixer_callback.vader b/test/fixers/test_tidy_fixer_callback.vader
new file mode 100644
index 00000000..5677d8fd
--- /dev/null
+++ b/test/fixers/test_tidy_fixer_callback.vader
@@ -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(''))