diff options
author | Martin Tournoij <martin@arp242.net> | 2017-12-23 13:13:55 +0000 |
---|---|---|
committer | Martin Tournoij <martin@arp242.net> | 2018-03-17 18:24:38 +0000 |
commit | 302f69e933b85628c688a1b16eab5dd2e7976e99 (patch) | |
tree | e27cb56d84dbe449fff9e3514c87e600feecf849 /test | |
parent | 92e6e4d1ba482a4d2d89d850f660c67ccf8a28eb (diff) | |
download | ale-302f69e933b85628c688a1b16eab5dd2e7976e99.zip |
Add ALEFixPre and ALEFixPost events
To run autocmd before and after every fix cycle.
Fixes #623 (`ALELintPre` was added in #1203).
Diffstat (limited to 'test')
-rw-r--r-- | test/fix/test_ale_fix.vader | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/fix/test_ale_fix.vader b/test/fix/test_ale_fix.vader index 5b66c92c..0321cbae 100644 --- a/test/fix/test_ale_fix.vader +++ b/test/fix/test_ale_fix.vader @@ -17,6 +17,14 @@ Before: \ 'testft': [], \} + let g:pre_success = 0 + let g:post_success = 0 + augroup VaderTest + autocmd! + autocmd User ALEFixPre let g:pre_success = 1 + autocmd User ALEFixPost let g:post_success = 1 + augroup end + if !has('win32') let &shell = '/bin/bash' endif @@ -171,6 +179,7 @@ After: unlet! g:ale_emulate_job_failure unlet! b:ale_fixers unlet! b:ale_fix_on_save + augroup! VaderTest delfunction AddCarets delfunction AddDollars delfunction DoNothing @@ -664,3 +673,9 @@ Expect(The lines in the JSON should be used): x y z + +Execute(ALEFix should apply autocmds): + let g:ale_fixers.testft = ['AddCarets'] + ALEFix + AssertEqual g:pre_success, 1 + AssertEqual g:post_success, 1 |