diff options
author | w0rp <devw0rp@gmail.com> | 2018-10-29 11:29:12 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-10-29 11:29:21 +0000 |
commit | 2846e862178e9a16e078799c28aa9d9d4a2ea505 (patch) | |
tree | 280fdf12616e46090cd4be58930a8b395ebbb43b /test | |
parent | 9dbebf1cb3909c47a69c07397a84da1369cf98d0 (diff) | |
download | ale-2846e862178e9a16e078799c28aa9d9d4a2ea505.zip |
#2017 Simplify lint cycles for supporting other sources later
Diffstat (limited to 'test')
-rw-r--r-- | test/smoke_test.vader | 8 | ||||
-rw-r--r-- | test/test_alelint_autocmd.vader | 8 | ||||
-rw-r--r-- | test/test_command_chain.vader | 2 | ||||
-rw-r--r-- | test/test_history_saving.vader | 6 | ||||
-rw-r--r-- | test/test_ignoring_linters.vader | 6 | ||||
-rw-r--r-- | test/test_lint_file_linters.vader | 1 | ||||
-rw-r--r-- | test/test_linting_blacklist.vader | 2 | ||||
-rw-r--r-- | test/test_sandbox_execution.vader | 1 | ||||
-rw-r--r-- | test/test_temporary_file_management.vader | 4 | ||||
-rw-r--r-- | test/test_verilog_verilator_options.vader | 2 |
10 files changed, 22 insertions, 18 deletions
diff --git a/test/smoke_test.vader b/test/smoke_test.vader index 2708c86f..c87f95b2 100644 --- a/test/smoke_test.vader +++ b/test/smoke_test.vader @@ -65,7 +65,7 @@ Execute(Linters should run with the default options): " Try the test a few times over in NeoVim 0.3 or Windows, " where tests fail randomly. for g:i in range(has('nvim-0.3') || has('win32') ? 5 : 1) - call ale#Lint() + call ale#Queue(0, '') call ale#engine#WaitForJobs(2000) let g:results = ale#test#GetLoclistWithoutModule() @@ -109,7 +109,7 @@ Execute(Linters should run in PowerShell too): \ 'command': 'echo foo && echo bar', \}) - call ale#Lint() + call ale#Queue(0, '') call ale#engine#WaitForJobs(4000) AssertEqual [ @@ -139,7 +139,7 @@ Execute(Linters should run in PowerShell too): endif Execute(Previous errors should be removed when linters change): - call ale#Lint() + call ale#Queue(0, '') call ale#engine#WaitForJobs(2000) call ale#linter#Reset() @@ -166,7 +166,7 @@ Execute(Previous errors should be removed when linters change): " Try the test a few times over in NeoVim 0.3 or Windows, " where tests fail randomly. for g:i in range(has('nvim-0.3') || has('win32') ? 5 : 1) - call ale#Lint() + call ale#Queue(0, '') call ale#engine#WaitForJobs(2000) let g:results = ale#test#GetLoclistWithoutModule() diff --git a/test/test_alelint_autocmd.vader b/test/test_alelint_autocmd.vader index 5af1cd47..9a7a6a43 100644 --- a/test/test_alelint_autocmd.vader +++ b/test/test_alelint_autocmd.vader @@ -14,7 +14,7 @@ After: catch endtry -Given foobar(An empty file): +Given testft(An empty file): Execute(Run a lint cycle, and check that a variable is set in the autocmd): augroup VaderTest autocmd! @@ -22,7 +22,7 @@ Execute(Run a lint cycle, and check that a variable is set in the autocmd): autocmd User ALELintPost let g:post_success = 1 augroup end - call ale#Lint() + call ale#Queue(0) AssertEqual g:pre_success, 1 AssertEqual g:post_success, 1 @@ -30,10 +30,10 @@ Execute(Run a lint cycle, and check that a variable is set in the autocmd): Execute(b:ale_linted should be increased after each lint cycle): AssertEqual get(b:, 'ale_linted'), 0 - call ale#Lint() + call ale#Queue(0) AssertEqual get(b:, 'ale_linted'), 1 - call ale#Lint() + call ale#Queue(0) AssertEqual get(b:, 'ale_linted'), 2 diff --git a/test/test_command_chain.vader b/test/test_command_chain.vader index 9059d630..591f6f40 100644 --- a/test/test_command_chain.vader +++ b/test/test_command_chain.vader @@ -62,7 +62,7 @@ Given foobar (Some imaginary filetype): Execute(Check the results of running the chain): AssertEqual 'foobar', &filetype - call ale#Lint() + call ale#Queue(0) Assert g:first_echo_called, 'The first chain item was not called' Assert g:second_echo_called, 'The second chain item was not called' diff --git a/test/test_history_saving.vader b/test/test_history_saving.vader index 375e96a1..d7a307b5 100644 --- a/test/test_history_saving.vader +++ b/test/test_history_saving.vader @@ -73,7 +73,7 @@ Execute(History should be set when commands are run): " Retry this test until it works. This one can randomly fail. for g:i in range(has('nvim-0.3') || has('win32') ? 5 : 1) let b:ale_history = [] - call ale#Lint() + call ale#Queue(0) call ale#engine#WaitForJobs(2000) let g:history = filter( @@ -106,7 +106,7 @@ Execute(History should be not set when disabled): let g:ale_history_enabled = 0 - call ale#Lint() + call ale#Queue(0) call ale#engine#WaitForJobs(2000) AssertEqual [], ale#history#Get(bufnr('')) @@ -120,7 +120,7 @@ Execute(History should include command output if logging is enabled): " Retry this test until it works. This one can randomly fail. for g:i in range(has('nvim-0.3') || has('win32') ? 5 : 1) let b:ale_history = [] - call ale#Lint() + call ale#Queue(0) call ale#engine#WaitForJobs(2000) let g:history = ale#history#Get(bufnr('')) diff --git a/test/test_ignoring_linters.vader b/test/test_ignoring_linters.vader index 1ddd30e8..f47c5e81 100644 --- a/test/test_ignoring_linters.vader +++ b/test/test_ignoring_linters.vader @@ -138,6 +138,9 @@ After: Given foobar(An empty file): Execute(Global ignore lists should be applied for linters): + " We have to set up buffer info so RunLinters is called. + let g:ale_buffer_info = {bufnr(''): {}} + ALELint Assert g:run_linters_called, "The mock callback wasn't called" AssertEqual ['testlinter'], map(g:linters, 'v:val.name') @@ -147,6 +150,9 @@ Execute(Global ignore lists should be applied for linters): AssertEqual [], g:linters Execute(buffer ignore lists should be applied for linters): + " We have to set up buffer info so RunLinters is called. + let g:ale_buffer_info = {bufnr(''): {}} + ALELint Assert g:run_linters_called, "The mock callback wasn't called" AssertEqual ['testlinter'], map(g:linters, 'v:val.name') diff --git a/test/test_lint_file_linters.vader b/test/test_lint_file_linters.vader index ca093aa8..f67fad44 100644 --- a/test/test_lint_file_linters.vader +++ b/test/test_lint_file_linters.vader @@ -10,7 +10,6 @@ Before: let g:ale_run_synchronously = 1 let g:ale_set_lists_synchronously = 1 let b:ale_save_event_fired = 0 - call ale#ResetLintFileMarkers() let g:buffer_result = [ \ { diff --git a/test/test_linting_blacklist.vader b/test/test_linting_blacklist.vader index 2d9ed585..73190b7f 100644 --- a/test/test_linting_blacklist.vader +++ b/test/test_linting_blacklist.vader @@ -10,7 +10,7 @@ Given unite (A Unite.vim file): anything Execute(Running ALE on a blacklisted file shouldn't change anything): - call ale#Lint() + call ale#Queue(0) call ale#engine#WaitForJobs(2000) AssertEqual {}, g:ale_buffer_info diff --git a/test/test_sandbox_execution.vader b/test/test_sandbox_execution.vader index 4dbcb0db..5a4974ba 100644 --- a/test/test_sandbox_execution.vader +++ b/test/test_sandbox_execution.vader @@ -47,7 +47,6 @@ Execute(ALE shouldn't blow up when run from a sandbox): sandbox call ale#Queue(0) sandbox call ale#Queue(1) - sandbox call ale#Lint() Execute(ALE shouldn't blow up if file cleanup happens in a sandbox): " Make a call to an engine function first, so the function will be defined diff --git a/test/test_temporary_file_management.vader b/test/test_temporary_file_management.vader index e248331c..4847706a 100644 --- a/test/test_temporary_file_management.vader +++ b/test/test_temporary_file_management.vader @@ -67,7 +67,7 @@ Given foobar (Some imaginary filetype): Execute(ALE should delete managed files/directories appropriately after linting): AssertEqual 'foobar', &filetype - call ale#Lint() + call ale#Queue(0) call ale#engine#WaitForJobs(2000) Assert !filereadable(g:filename), 'The temporary file was not deleted' @@ -79,7 +79,7 @@ Execute(ALE should delete managed files even if no command is run): let g:command = '' - call ale#Lint() + call ale#Queue(0) call ale#engine#WaitForJobs(2000) Assert !filereadable(g:filename), 'The temporary file was not deleted' diff --git a/test/test_verilog_verilator_options.vader b/test/test_verilog_verilator_options.vader index e53037b1..3ebabfcc 100644 --- a/test/test_verilog_verilator_options.vader +++ b/test/test_verilog_verilator_options.vader @@ -12,7 +12,7 @@ Execute(Set Verilog Verilator linter additional options to `-sv --default-langua " Additional args for the linter let g:ale_verilog_verilator_options = '-sv --default-language "1800-2012"' - call ale#Lint() + call ale#Queue(0) let g:run_cmd = ale_linters#verilog#verilator#GetCommand(bufnr('')) let g:matched = match(g:run_cmd, '\s' . g:ale_verilog_verilator_options . '\s') |