summaryrefslogtreecommitdiff
path: root/test/fixers/test_latexindent_fixer_callback.vader
diff options
context:
space:
mode:
authorRiley Martine <riley.martine@protonmail.com>2019-04-13 20:21:59 +0800
committerw0rp <w0rp@users.noreply.github.com>2019-04-13 13:21:59 +0100
commit495bce32e957dcf45d6d6acf183599e18c92b09d (patch)
treef82cc04c19d10351b5021ef83e0951f58e2c9eeb /test/fixers/test_latexindent_fixer_callback.vader
parentf0f0cc3c186c46f437d62e6b3e01a45d2a3aaf47 (diff)
downloadale-495bce32e957dcf45d6d6acf183599e18c92b09d.zip
Add support for latexindent (#2387)
Diffstat (limited to 'test/fixers/test_latexindent_fixer_callback.vader')
-rw-r--r--test/fixers/test_latexindent_fixer_callback.vader40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/fixers/test_latexindent_fixer_callback.vader b/test/fixers/test_latexindent_fixer_callback.vader
new file mode 100644
index 00000000..d0da94a1
--- /dev/null
+++ b/test/fixers/test_latexindent_fixer_callback.vader
@@ -0,0 +1,40 @@
+Before:
+ Save g:ale_tex_latexindent_executable
+ Save g:ale_tex_latexindent_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_tex_latexindent_executable = 'xxxinvalid'
+ let g:ale_tex_latexindent_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The latexindent callback should return the correct default values):
+ call ale#test#SetFilename('../tex_files/testfile.tex')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -l -w'
+ \ . ' %t',
+ \ },
+ \ ale#fixers#latexindent#Fix(bufnr(''))
+
+Execute(The latexindent callback should include custom gofmt options):
+ let g:ale_tex_latexindent_options = "-l '~/.indentconfig.yaml'"
+ call ale#test#SetFilename('../tex_files/testfile.tex')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape('xxxinvalid')
+ \ . ' -l -w'
+ \ . ' ' . g:ale_tex_latexindent_options
+ \ . ' %t',
+ \ },
+ \ ale#fixers#latexindent#Fix(bufnr(''))