diff options
author | Jasper Woudenberg <mail@jasperwoudenberg.com> | 2017-03-02 19:04:28 -0800 |
---|---|---|
committer | Jasper Woudenberg <mail@jasperwoudenberg.com> | 2017-03-02 19:04:28 -0800 |
commit | edc5dee2269d4007303d654be4105dee225c5396 (patch) | |
tree | d96abffdca0e8e292e925c14846935c7f3d8c57a /test/test_cursor_warnings.vader | |
parent | ae88263f0ff5d50563c43745acf2f48ea9a8d057 (diff) | |
parent | 969274ccc2a2d334d36b3e767de362b8dc40f4e2 (diff) | |
download | ale-edc5dee2269d4007303d654be4105dee225c5396.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'test/test_cursor_warnings.vader')
-rw-r--r-- | test/test_cursor_warnings.vader | 49 |
1 files changed, 42 insertions, 7 deletions
diff --git a/test/test_cursor_warnings.vader b/test/test_cursor_warnings.vader index 136e6abc..75d6c975 100644 --- a/test/test_cursor_warnings.vader +++ b/test/test_cursor_warnings.vader @@ -37,7 +37,16 @@ Before: \ }, \} + " Turn off other features, we only care about this one feature in this test. + let g:ale_set_loclist = 0 + let g:ale_set_signs = 0 + let g:ale_set_highlights = 0 + After: + let g:ale_set_loclist = 1 + let g:ale_set_signs = 1 + let g:ale_set_highlights = 1 + unlet! g:output unlet! g:lines let g:ale_buffer_info = {} @@ -52,7 +61,7 @@ Execute(Evaluate the cursor function at line 1): Then(Check the cursor output): redir => g:output - :mess + silent mess redir END let g:lines = split(g:output, "\n") @@ -65,7 +74,7 @@ Execute(Evaluate the cursor function at line 2): Then(Check the cursor output): redir => g:output - :mess + silent mess redir END let g:lines = split(g:output, "\n") @@ -79,13 +88,43 @@ Execute(Evaluate the cursor function later in line 2): Then(Check the cursor output): redir => g:output - :mess + silent mess redir END let g:lines = split(g:output, "\n") AssertEqual 'Missing radix parameter (radix)', g:lines[-1] +Execute(Set results for a lint cycle, with the cursor on line 1): + :1 + call ale#engine#SetResults( + \ bufnr('%'), + \ g:ale_buffer_info[bufnr('%')].loclist, + \) + +Then(Check the cursor output): + redir => g:output + silent mess + redir END + + let g:lines = split(g:output, "\n") + + AssertEqual 'Missing semicolon. (semi)', g:lines[-1] + +Execute(Simulate leaving insert mode on line 2): + :2 + normal 16h + doautocmd InsertLeave + +Then(Check the cursor output): + redir => g:output + silent mess + redir END + + let g:lines = split(g:output, "\n") + + AssertEqual 'Infix operators must be spaced. (space-infix-ops)', g:lines[-1] + Execute(Evaluate the cursor detail function at line 1): :1 call ale#cursor#ShowCursorDetail() @@ -95,8 +134,6 @@ Then(Check the cursor output): :mess redir END - let g:lines = split(g:output, "\n") - AssertEqual "Every statement should end with a semicolon", g:lines[-1] Execute(Evaluate the cursor detail function at line 2): @@ -108,6 +145,4 @@ Then(Check the cursor output): :mess redir END - let g:lines = split(g:output, "\n") - AssertEqual "Infix operators must be spaced. (space-infix-ops)", g:lines[-1] |