summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/sign/test_sign_placement.vader2
-rw-r--r--test/test_alelint_autocmd.vader1
-rw-r--r--test/test_engine_lsp_response_handling.vader1
-rw-r--r--test/test_lint_error_delay.vader1
-rw-r--r--test/test_should_do_nothing_conditions.vader11
-rw-r--r--test/test_temporary_file_management.vader19
-rw-r--r--test/test_verilog_verilator_options.vader1
7 files changed, 35 insertions, 1 deletions
diff --git a/test/sign/test_sign_placement.vader b/test/sign/test_sign_placement.vader
index 36f34e16..19267fe7 100644
--- a/test/sign/test_sign_placement.vader
+++ b/test/sign/test_sign_placement.vader
@@ -1,7 +1,9 @@
Before:
Save g:ale_set_signs
+ Save g:ale_buffer_info
let g:ale_set_signs = 1
+ let g:ale_buffer_info = {}
call ale#linter#Reset()
sign unplace *
diff --git a/test/test_alelint_autocmd.vader b/test/test_alelint_autocmd.vader
index d51694ff..5af1cd47 100644
--- a/test/test_alelint_autocmd.vader
+++ b/test/test_alelint_autocmd.vader
@@ -14,6 +14,7 @@ After:
catch
endtry
+Given foobar(An empty file):
Execute(Run a lint cycle, and check that a variable is set in the autocmd):
augroup VaderTest
autocmd!
diff --git a/test/test_engine_lsp_response_handling.vader b/test/test_engine_lsp_response_handling.vader
index 4c6fe637..3d317e9c 100644
--- a/test/test_engine_lsp_response_handling.vader
+++ b/test/test_engine_lsp_response_handling.vader
@@ -13,6 +13,7 @@ After:
call ale#linter#Reset()
call ale#engine#ClearLSPData()
+Given foobar(An empty file):
Execute(tsserver syntax error responses should be handled correctly):
runtime ale_linters/typescript/tsserver.vim
call ale#test#SetFilename('filename.ts')
diff --git a/test/test_lint_error_delay.vader b/test/test_lint_error_delay.vader
index 05664899..d5397087 100644
--- a/test/test_lint_error_delay.vader
+++ b/test/test_lint_error_delay.vader
@@ -11,6 +11,7 @@ After:
call ale#ResetErrorDelays()
+Given foobar(An empty file):
Execute(ALE should stop queuing for a while after exceptions are thrown):
AssertThrows call ale#Queue(100)
call ale#Queue(100)
diff --git a/test/test_should_do_nothing_conditions.vader b/test/test_should_do_nothing_conditions.vader
index 85874e53..062ab875 100644
--- a/test/test_should_do_nothing_conditions.vader
+++ b/test/test_should_do_nothing_conditions.vader
@@ -26,6 +26,7 @@ After:
unlet! b:funky_command_created
+Given foobar(An empty file):
Execute(ALE shouldn't do much of anything for ctrlp-funky buffers):
Assert !ale#ShouldDoNothing(bufnr('')), 'The preliminary check failed'
@@ -43,6 +44,16 @@ Execute(ALE shouldn't try to check buffers with '.' as the filename):
Assert ale#ShouldDoNothing(bufnr(''))
+Execute(DoNothing should return 0 when the filetype is empty):
+ AssertEqual
+ \ 0,
+ \ ale#ShouldDoNothing(bufnr('')),
+ \ 'ShouldDoNothing() was 1 for some other reason'
+
+ set filetype=
+
+ AssertEqual 1, ale#ShouldDoNothing(bufnr(''))
+
Execute(The DoNothing check should work if the ALE globals aren't defined):
unlet! g:ale_filetype_blacklist
unlet! g:ale_maximum_file_size
diff --git a/test/test_temporary_file_management.vader b/test/test_temporary_file_management.vader
index ae2bf251..e248331c 100644
--- a/test/test_temporary_file_management.vader
+++ b/test/test_temporary_file_management.vader
@@ -1,4 +1,7 @@
Before:
+ Save g:ale_buffer_info
+
+ let g:ale_buffer_info = {}
let g:ale_run_synchronously = 1
let g:command = 'echo test'
@@ -41,6 +44,8 @@ Before:
\})
After:
+ Restore
+
if !empty(g:preserved_directory)
call delete(g:preserved_directory, 'rf')
endif
@@ -111,3 +116,17 @@ Execute(ALE should create and delete directories for ale#engine#CreateDirectory(
Assert !isdirectory(b:dir), 'The directory was not deleted'
Assert !isdirectory(b:dir2), 'The second directory was not deleted'
+
+Execute(ale#engine#ManageFile should add the file even if the buffer info hasn't be set yet):
+ let g:ale_buffer_info = {}
+ call ale#engine#ManageFile(bufnr(''), '/foo/bar')
+ AssertEqual
+ \ ['/foo/bar'],
+ \ g:ale_buffer_info[bufnr('')].temporary_file_list
+
+Execute(ale#engine#ManageDirectory should add the directory even if the buffer info hasn't be set yet):
+ let g:ale_buffer_info = {}
+ call ale#engine#ManageDirectory(bufnr(''), '/foo/bar')
+ AssertEqual
+ \ ['/foo/bar'],
+ \ g:ale_buffer_info[bufnr('')].temporary_directory_list
diff --git a/test/test_verilog_verilator_options.vader b/test/test_verilog_verilator_options.vader
index 561786ee..e53037b1 100644
--- a/test/test_verilog_verilator_options.vader
+++ b/test/test_verilog_verilator_options.vader
@@ -22,4 +22,3 @@ Execute(Set Verilog Verilator linter additional options to `-sv --default-langua
\ g:matched ,
\ -1 ,
\ 'Additionnal arguments not found in the run command'
-