diff options
author | w0rp <devw0rp@gmail.com> | 2018-03-25 12:57:08 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-03-25 12:57:08 +0100 |
commit | 164c711b3da5a51a2323a3bd613df251ce455ca5 (patch) | |
tree | 25796d3a5776c4789def6ee00b68fca95a8db2e4 /test/test_ale_toggle.vader | |
parent | 107516c757df82d2ee84426de9b35fd52e953c5c (diff) | |
download | ale-164c711b3da5a51a2323a3bd613df251ce455ca5.zip |
Fix #1404 - Do not show balloons when g:ale_set_balloons is 0. Add b:ale_set_balloonsv1.8.0
Diffstat (limited to 'test/test_ale_toggle.vader')
-rw-r--r-- | test/test_ale_toggle.vader | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/test_ale_toggle.vader b/test/test_ale_toggle.vader index d56f8c2b..ca8b25d5 100644 --- a/test/test_ale_toggle.vader +++ b/test/test_ale_toggle.vader @@ -5,12 +5,14 @@ Before: Save g:ale_run_synchronously Save g:ale_pattern_options Save g:ale_pattern_options_enabled + Save g:ale_set_balloons let g:ale_set_signs = 1 let g:ale_set_lists_synchronously = 1 let g:ale_run_synchronously = 1 let g:ale_pattern_options = {} let g:ale_pattern_options_enabled = 1 + let g:ale_set_balloons = has('balloon_eval') unlet! b:ale_enabled @@ -344,3 +346,41 @@ Execute(ALEResetBuffer should reset everything for a buffer): AssertEqual 1, g:ale_enabled AssertEqual 1, get(b:, 'ale_enabled', 1) + +Execute(Disabling ALE should disable balloons): + " These tests won't run in the console, but we can run them manually in GVim. + if has('balloon_eval') + call ale#linter#Reset() + + " Enable balloons, so we can check the expr value. + call ale#balloon#Enable() + + AssertEqual 1, &ballooneval + AssertEqual 'ale#balloon#Expr()', &balloonexpr + + " Toggle ALE off. + ALEToggle + + " The balloon settings should be reset. + AssertEqual 0, &ballooneval + AssertEqual '', &balloonexpr + endif + +Execute(Enabling ALE should enable balloons if the setting is on): + if has('balloon_eval') + call ale#linter#Reset() + call ale#balloon#Disable() + ALEDisable + let g:ale_set_balloons = 0 + ALEEnable + + AssertEqual 0, &ballooneval + AssertEqual '', &balloonexpr + + ALEDisable + let g:ale_set_balloons = 1 + ALEEnable + + AssertEqual 1, &ballooneval + AssertEqual 'ale#balloon#Expr()', &balloonexpr + endif |