summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
authorHoracio Sanson <hsanson@gmail.com>2021-01-20 21:06:03 +0900
committerGitHub <noreply@github.com>2021-01-20 21:06:03 +0900
commit7e3d2930d8defbcb233b0bc21822cb8e8377bec2 (patch)
tree7ab9ffb56c40d2287103dc56c6ba831dcea8ea8b /test/fixers
parent7b42dd7387f4c45ac7d5fffb6662d0177f5e1d54 (diff)
parent3229d5aba468d01c418accbd59562cd75d7f1ddf (diff)
downloadale-7e3d2930d8defbcb233b0bc21822cb8e8377bec2.zip
Merge pull request #3261 from toastal/dhall
Enhanced Dhall fixer support
Diffstat (limited to 'test/fixers')
-rw-r--r--test/fixers/test_dhall_fixer_callback.vader11
-rw-r--r--test/fixers/test_dhall_format_fixer_callback.vader24
-rw-r--r--test/fixers/test_dhall_freeze_fixer_callback.vader24
-rw-r--r--test/fixers/test_dhall_lint_fixer_callback.vader22
4 files changed, 70 insertions, 11 deletions
diff --git a/test/fixers/test_dhall_fixer_callback.vader b/test/fixers/test_dhall_fixer_callback.vader
deleted file mode 100644
index f27880b7..00000000
--- a/test/fixers/test_dhall_fixer_callback.vader
+++ /dev/null
@@ -1,11 +0,0 @@
-Before:
- call ale#assert#SetUpFixerTest('dhall', 'dhall')
-
-After:
- call ale#assert#TearDownFixerTest()
-
-Execute(The default command should be correct):
- AssertFixer
- \ { 'read_temporary_file': 1,
- \ 'command': ale#Escape('dhall') . ' format --inplace %t'
- \ }
diff --git a/test/fixers/test_dhall_format_fixer_callback.vader b/test/fixers/test_dhall_format_fixer_callback.vader
new file mode 100644
index 00000000..9bc17f7e
--- /dev/null
+++ b/test/fixers/test_dhall_format_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ Save g:ale_dhall_executable
+ Save g:ale_dhall_options
+
+ " Use an invalid global executable, so we don’t match it.
+ let g:ale_dhall_executable = 'odd-dhall'
+ let g:ale_dhall_options = '--ascii'
+
+ call ale#assert#SetUpFixerTest('dhall-format', 'dhall-format')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The dhall-format callback should return the correct options):
+ call ale#test#SetFilename('../dhall_files/testfile.dhall')
+
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape('odd-dhall')
+ \ . ' --ascii'
+ \ . ' format'
+ \ . ' --inplace %t',
+ \ 'read_temporary_file': 1,
+ \ }
diff --git a/test/fixers/test_dhall_freeze_fixer_callback.vader b/test/fixers/test_dhall_freeze_fixer_callback.vader
new file mode 100644
index 00000000..c8f820bb
--- /dev/null
+++ b/test/fixers/test_dhall_freeze_fixer_callback.vader
@@ -0,0 +1,24 @@
+Before:
+ Save g:ale_dhall_executable
+ Save g:ale_dhall_options
+
+ " Use an invalid global executable, so we don’t match it.
+ let g:ale_dhall_executable = 'odd-dhall'
+ let g:ale_dhall_options = '--ascii'
+ let g:ale_dhall_freeze_options = '--all'
+
+ call ale#assert#SetUpFixerTest('dhall-freeze', 'dhall-freeze')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The dhall-freeze callback should return the correct options):
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape('odd-dhall')
+ \ . ' --ascii'
+ \ . ' freeze'
+ \ . ' --all'
+ \ . ' --inplace %t',
+ \ 'read_temporary_file': 1,
+ \ }
diff --git a/test/fixers/test_dhall_lint_fixer_callback.vader b/test/fixers/test_dhall_lint_fixer_callback.vader
new file mode 100644
index 00000000..82229363
--- /dev/null
+++ b/test/fixers/test_dhall_lint_fixer_callback.vader
@@ -0,0 +1,22 @@
+Before:
+ Save g:ale_dhall_executable
+ Save g:ale_dhall_options
+
+ " Use an invalid global executable, so we don’t match it.
+ let g:ale_dhall_executable = 'odd-dhall'
+ let g:ale_dhall_options = '--ascii'
+
+ call ale#assert#SetUpFixerTest('dhall-lint', 'dhall-lint')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The dhall-lint callback should return the correct options):
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape('odd-dhall')
+ \ . ' --ascii'
+ \ . ' lint'
+ \ . ' --inplace %t',
+ \ 'read_temporary_file': 1,
+ \ }