diff options
author | w0rp <devw0rp@gmail.com> | 2017-05-19 09:53:28 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-05-20 19:02:36 +0100 |
commit | e6b132c915f11e7ff4962f14bfeba1bd77cd5f9f (patch) | |
tree | 879cd5cf4992b024fe179dc5ee8098777b82f458 /test | |
parent | 4214832ae263086d1aa1f565067d00e9ed1b820e (diff) | |
download | ale-e6b132c915f11e7ff4962f14bfeba1bd77cd5f9f.zip |
Fix an off-by-one bug in ALEFix
Diffstat (limited to 'test')
-rw-r--r-- | test/test_ale_fix.vader | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test_ale_fix.vader b/test/test_ale_fix.vader index 8e61aefe..71fd84fe 100644 --- a/test/test_ale_fix.vader +++ b/test/test_ale_fix.vader @@ -28,6 +28,9 @@ Before: return {'command': 'echo x > %t', 'read_temporary_file': 1} endfunction + function RemoveLastLine(buffer, lines) abort + return ['a', 'b'] + endfunction After: Restore unlet! g:ale_run_synchronously @@ -37,6 +40,7 @@ After: delfunction DoNothing delfunction CatLine delfunction ReplaceWithTempFile + delfunction RemoveLastLine call ale#fix#registry#ResetToDefaults() Given testft (A file with three lines): @@ -137,3 +141,11 @@ Expect(The registry function should be used): ^a ^b ^c + +Execute(ALEFix should be able to remove the last line for files): + let g:ale_fixers.testft = ['RemoveLastLine'] + ALEFix + +Expect(There should be only two lines): + a + b |