summaryrefslogtreecommitdiff
path: root/test/test_should_do_nothing_conditions.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-09-03 13:59:56 +0100
committerw0rp <devw0rp@gmail.com>2018-09-03 13:59:56 +0100
commitfddbfdef12db62d9dd8f55ef659967817c749930 (patch)
treec04a1b7f5a765c3a731dbc0ce01c85fbbda063ce /test/test_should_do_nothing_conditions.vader
parenta746ea2bfc1e01b9455d9efec3e95799be4177f2 (diff)
downloadale-fddbfdef12db62d9dd8f55ef659967817c749930.zip
#1875 Do not lint and so on when an operator is pending
Diffstat (limited to 'test/test_should_do_nothing_conditions.vader')
-rw-r--r--test/test_should_do_nothing_conditions.vader18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/test_should_do_nothing_conditions.vader b/test/test_should_do_nothing_conditions.vader
index 062ab875..de2e2782 100644
--- a/test/test_should_do_nothing_conditions.vader
+++ b/test/test_should_do_nothing_conditions.vader
@@ -4,10 +4,18 @@ Before:
Save g:ale_enabled
Save &l:statusline
+ let b:fake_mode = 'n'
+
call ale#test#SetDirectory('/testplugin/test')
let b:funky_command_created = 0
+ runtime autoload/ale/util.vim
+
+ function! ale#util#Mode(...) abort
+ return b:fake_mode
+ endfunction
+
" We will test for the existence of this command, so create one if needed.
if !exists(':CtrlPFunky')
command CtrlPFunky echo
@@ -25,6 +33,9 @@ After:
endif
unlet! b:funky_command_created
+ unlet! b:fake_mode
+
+ runtime autoload/ale/util.vim
Given foobar(An empty file):
Execute(ALE shouldn't do much of anything for ctrlp-funky buffers):
@@ -44,7 +55,7 @@ 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):
+Execute(DoNothing should return 1 when the filetype is empty):
AssertEqual
\ 0,
\ ale#ShouldDoNothing(bufnr('')),
@@ -54,6 +65,11 @@ Execute(DoNothing should return 0 when the filetype is empty):
AssertEqual 1, ale#ShouldDoNothing(bufnr(''))
+Execute(DoNothing should return 1 when an operator is pending):
+ let b:fake_mode = 'no'
+
+ 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