summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/bazel_paths/BUILD0
-rw-r--r--test/command_callback/bazel_paths/WORKSPACE0
-rw-r--r--test/command_callback/bazel_paths/defs.bzl0
-rw-r--r--test/fixers/test_buildifier_fixer_callback.vader43
4 files changed, 43 insertions, 0 deletions
diff --git a/test/command_callback/bazel_paths/BUILD b/test/command_callback/bazel_paths/BUILD
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/bazel_paths/BUILD
diff --git a/test/command_callback/bazel_paths/WORKSPACE b/test/command_callback/bazel_paths/WORKSPACE
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/bazel_paths/WORKSPACE
diff --git a/test/command_callback/bazel_paths/defs.bzl b/test/command_callback/bazel_paths/defs.bzl
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/bazel_paths/defs.bzl
diff --git a/test/fixers/test_buildifier_fixer_callback.vader b/test/fixers/test_buildifier_fixer_callback.vader
new file mode 100644
index 00000000..36de9819
--- /dev/null
+++ b/test/fixers/test_buildifier_fixer_callback.vader
@@ -0,0 +1,43 @@
+Before:
+ let g:ale_bazel_buildifier_options = ''
+ call ale#assert#SetUpFixerTest('bzl', 'buildifier')
+
+After:
+ call ale#assert#TearDownFixerTest()
+
+Execute(The buildifier callback should return the correct default values):
+ call ale#test#SetFilename('bazel_paths/WORKSPACE')
+
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape(g:ale_bazel_buildifier_executable)
+ \ . ' -mode fix -lint fix -type workspace -'
+ \ }
+
+Execute(The buildifier callback should include any additional options):
+ call ale#test#SetFilename('bazel_paths/WORKSPACE')
+ let g:ale_bazel_buildifier_options = '--some-option'
+
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape(g:ale_bazel_buildifier_executable)
+ \ . ' -mode fix -lint fix -type workspace --some-option -',
+ \ }
+
+Execute(The buildifier callback should recognize BUILD files):
+ call ale#test#SetFilename('bazel_paths/BUILD')
+
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape(g:ale_bazel_buildifier_executable)
+ \ . ' -mode fix -lint fix -type build -'
+ \ }
+
+Execute(The buildifier callback should recognize .bzl files):
+ call ale#test#SetFilename('bazel_paths/defs.bzl')
+
+ AssertFixer
+ \ {
+ \ 'command': ale#Escape(g:ale_bazel_buildifier_executable)
+ \ . ' -mode fix -lint fix -type bzl -'
+ \ }