summaryrefslogtreecommitdiff
path: root/test/fixers/test_buf_format_fixer_callback.vader
diff options
context:
space:
mode:
authorAlex McKinney <alexmckinney01@gmail.com>2022-04-06 01:00:59 -0700
committerGitHub <noreply@github.com>2022-04-06 17:00:59 +0900
commit607f33a1b0f662d9809d54363e8e81a4965862ce (patch)
tree4795d8a2dd649f930202b93e25dadf4bd6f8402a /test/fixers/test_buf_format_fixer_callback.vader
parent1e997580fdbb8e11e043af071c97d3aa879cf875 (diff)
downloadale-607f33a1b0f662d9809d54363e8e81a4965862ce.zip
Add buf linter and fixer (#4128)
* Add buf lint to linters * Add buf format to fixers * Fix test/linter/test_buf_lint.vader * Fix test/fixers/test_buf_format_fixer_callback.vader * Simplify test/test-files/proto/testfile.proto * Add buf-lint alias and rename linter
Diffstat (limited to 'test/fixers/test_buf_format_fixer_callback.vader')
-rw-r--r--test/fixers/test_buf_format_fixer_callback.vader21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/fixers/test_buf_format_fixer_callback.vader b/test/fixers/test_buf_format_fixer_callback.vader
new file mode 100644
index 00000000..ee484820
--- /dev/null
+++ b/test/fixers/test_buf_format_fixer_callback.vader
@@ -0,0 +1,21 @@
+Before:
+ Save g:ale_proto_buf_format_executable
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_proto_buf_format_executable = 'xxxinvalid'
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The buf-format callback should return the correct default values):
+ call ale#test#SetFilename('../test-files/proto/testfile.proto')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('xxxinvalid') . ' format %t',
+ \ },
+ \ ale#fixers#buf_format#Fix(bufnr(''))