summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-02-10 19:34:44 +0000
committerw0rp <devw0rp@gmail.com>2017-02-10 19:34:44 +0000
commit926cd1a9533a816b0dbd7f6ca2ccbd2cd9cc2399 (patch)
tree85041ee5b7e286e3d8c54c918509c932f3ab4c43 /test
parentc528ab1eaa2fa951bde708a094274a4a05e03ebb (diff)
downloadale-926cd1a9533a816b0dbd7f6ca2ccbd2cd9cc2399.zip
Fix #283 Add an option for using ch_sendraw(), which can be better for some users
Diffstat (limited to 'test')
-rw-r--r--test/smoke_test.vader68
1 files changed, 68 insertions, 0 deletions
diff --git a/test/smoke_test.vader b/test/smoke_test.vader
new file mode 100644
index 00000000..9d0ea3f4
--- /dev/null
+++ b/test/smoke_test.vader
@@ -0,0 +1,68 @@
+Before:
+ function! TestCallback(buffer, output)
+ return [{
+ \ 'bufnr': a:buffer,
+ \ 'lnum': 2,
+ \ 'vcol': 0,
+ \ 'col': 3,
+ \ 'text': a:output[0],
+ \ 'type': 'E',
+ \ 'nr': -1,
+ \}]
+ endfunction
+
+ call ale#linter#Define('foobar', {
+ \ 'name': 'testlinter',
+ \ 'callback': 'TestCallback',
+ \ 'executable': 'echo',
+ \ 'command': 'echo foo bar',
+ \})
+
+After:
+ let g:ale_use_ch_sendraw = 0
+ let g:ale_buffer_info = {}
+ delfunction TestCallback
+ call ale#linter#Reset()
+
+Given foobar (Some imaginary filetype):
+ foo
+ bar
+ baz
+
+Execute(Linters should run with the default options):
+ AssertEqual 'foobar', &filetype
+
+ call ale#Lint()
+ call ale#engine#WaitForJobs(2000)
+
+ AssertEqual [{
+ \ 'bufnr': bufnr('%'),
+ \ 'lnum': 2,
+ \ 'vcol': 0,
+ \ 'col': 3,
+ \ 'text': 'foo bar',
+ \ 'type': 'E',
+ \ 'nr': -1,
+ \ 'pattern': '',
+ \ 'valid': 1,
+ \ }], getloclist(0)
+
+Execute(Linters should run with `let g:ale_use_ch_sendraw = 1`):
+ AssertEqual 'foobar', &filetype
+
+ let g:ale_use_ch_sendraw = 1
+
+ call ale#Lint()
+ call ale#engine#WaitForJobs(2000)
+
+ AssertEqual [{
+ \ 'bufnr': bufnr('%'),
+ \ 'lnum': 2,
+ \ 'vcol': 0,
+ \ 'col': 3,
+ \ 'text': 'foo bar',
+ \ 'type': 'E',
+ \ 'nr': -1,
+ \ 'pattern': '',
+ \ 'valid': 1,
+ \ }], getloclist(0)