summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-08-01 00:03:24 +0100
committerw0rp <devw0rp@gmail.com>2017-08-01 00:03:24 +0100
commita4ffd2f37c5d535d62170f7e3021cd2981689988 (patch)
tree3216004415ad5d39a42e105c6969fc59dfdea031 /test
parentec82530247547a696f888cdefd4aeec5cf3d40cf (diff)
downloadale-a4ffd2f37c5d535d62170f7e3021cd2981689988.zip
#734 - Use the buffer number from the events for entering buffers and saving buffers for checking buffers
Diffstat (limited to 'test')
-rw-r--r--test/test_ale_fix.vader6
-rw-r--r--test/test_ale_init_au_groups.vader12
-rw-r--r--test/test_lint_on_enter_when_file_changed.vader2
3 files changed, 10 insertions, 10 deletions
diff --git a/test/test_ale_fix.vader b/test/test_ale_fix.vader
index d7c3fb35..bafeee2b 100644
--- a/test/test_ale_fix.vader
+++ b/test/test_ale_fix.vader
@@ -246,7 +246,7 @@ Execute(ALEFix should save files on the save event):
let g:ale_fixers.testft = ['AddDollars']
call SetUpLinters()
- call ale#events#SaveEvent()
+ call ale#events#SaveEvent(bufnr(''))
" We should save the file.
AssertEqual ['$a', '$b', '$c'], readfile('fix_test_file')
@@ -285,7 +285,7 @@ Execute(ALEFix should still lint with no linters to be applied):
let g:ale_fixers.testft = []
call SetUpLinters()
- call ale#events#SaveEvent()
+ call ale#events#SaveEvent(bufnr(''))
Assert !filereadable('fix_test_file'), 'The file should not have been saved'
@@ -317,7 +317,7 @@ Execute(ALEFix should still lint when nothing was fixed on save):
let g:ale_fixers.testft = ['DoNothing']
call SetUpLinters()
- call ale#events#SaveEvent()
+ call ale#events#SaveEvent(bufnr(''))
Assert !filereadable('fix_test_file'), 'The file should not have been saved'
diff --git a/test/test_ale_init_au_groups.vader b/test/test_ale_init_au_groups.vader
index c20f4f97..e036343b 100644
--- a/test/test_ale_init_au_groups.vader
+++ b/test/test_ale_init_au_groups.vader
@@ -116,9 +116,9 @@ Execute (g:ale_lint_on_enter = 1 should bind the required events):
let g:ale_lint_on_enter = 1
AssertEqual [
- \ 'BufEnter * call ale#events#EnterEvent()',
- \ 'BufReadPost * call ale#Queue(300, ''lint_file'')',
- \ 'BufWinEnter * call ale#Queue(300, ''lint_file'')',
+ \ 'BufEnter * call ale#events#EnterEvent(str2nr(expand(''<abuf>'')))',
+ \ 'BufReadPost * call ale#Queue(0, ''lint_file'', str2nr(expand(''<abuf>'')))',
+ \ 'BufWinEnter * call ale#Queue(0, ''lint_file'', str2nr(expand(''<abuf>'')))',
\ 'FileChangedShellPost * call ale#events#FileChangedEvent(str2nr(expand(''<abuf>'')))',
\], CheckAutocmd('ALERunOnEnterGroup')
@@ -151,7 +151,7 @@ Execute (g:ale_lint_on_save = 1 should bind no events):
let g:ale_fix_on_save = 0
AssertEqual [
- \ 'BufWritePost * call ale#events#SaveEvent()',
+ \ 'BufWritePost * call ale#events#SaveEvent(str2nr(expand(''<abuf>'')))',
\], CheckAutocmd('ALERunOnSaveGroup')
Execute (g:ale_lint_on_save = 0 and g:ale_fix_on_save = 1 should bind events):
@@ -159,7 +159,7 @@ Execute (g:ale_lint_on_save = 0 and g:ale_fix_on_save = 1 should bind events):
let g:ale_fix_on_save = 1
AssertEqual [
- \ 'BufWritePost * call ale#events#SaveEvent()',
+ \ 'BufWritePost * call ale#events#SaveEvent(str2nr(expand(''<abuf>'')))',
\], CheckAutocmd('ALERunOnSaveGroup')
Execute (g:ale_fix_on_save = 1 should bind events even when ALE is disabled):
@@ -168,7 +168,7 @@ Execute (g:ale_fix_on_save = 1 should bind events even when ALE is disabled):
let g:ale_fix_on_save = 1
AssertEqual [
- \ 'BufWritePost * call ale#events#SaveEvent()',
+ \ 'BufWritePost * call ale#events#SaveEvent(str2nr(expand(''<abuf>'')))',
\], CheckAutocmd('ALERunOnSaveGroup')
Execute (g:ale_echo_cursor = 0 should bind no events):
diff --git a/test/test_lint_on_enter_when_file_changed.vader b/test/test_lint_on_enter_when_file_changed.vader
index cfa53878..4d4f19cc 100644
--- a/test/test_lint_on_enter_when_file_changed.vader
+++ b/test/test_lint_on_enter_when_file_changed.vader
@@ -64,7 +64,7 @@ Execute(The buffer should be checked after entering it after the file has change
let b:ale_file_changed = 1
set filetype=foobar
- call ale#events#EnterEvent()
+ call ale#events#EnterEvent(bufnr(''))
AssertEqual [{
\ 'bufnr': bufnr(''),