diff options
Diffstat (limited to 'test/test_loclist_corrections.vader')
-rw-r--r-- | test/test_loclist_corrections.vader | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/test_loclist_corrections.vader b/test/test_loclist_corrections.vader index a00eb21a..e0a21da1 100644 --- a/test/test_loclist_corrections.vader +++ b/test/test_loclist_corrections.vader @@ -1,4 +1,5 @@ After: + unlet! b:temp_name unlet! b:other_bufnr Given foo (Some file with lines to count): @@ -291,3 +292,40 @@ Execute(FixLocList should accept filenames): \ {'text': 'a', 'lnum': 5, 'filename': '/foo/bar/baz'}, \ ], \ ) + +Execute(FixLocList should interpret temporary filenames as being the current buffer): + let b:temp_name = tempname() + + AssertEqual + \ [ + \ { + \ 'text': 'a', + \ 'lnum': 2, + \ 'col': 0, + \ 'bufnr': bufnr(''), + \ 'filename': b:temp_name, + \ 'vcol': 0, + \ 'type': 'E', + \ 'nr': -1, + \ 'linter_name': 'foobar', + \ }, + \ { + \ 'text': 'a', + \ 'lnum': 3, + \ 'col': 0, + \ 'bufnr': bufnr(''), + \ 'filename': b:temp_name, + \ 'vcol': 0, + \ 'type': 'E', + \ 'nr': -1, + \ 'linter_name': 'foobar', + \ }, + \], + \ ale#engine#FixLocList( + \ bufnr(''), + \ 'foobar', + \ [ + \ {'text': 'a', 'lnum': 2, 'filename': b:temp_name}, + \ {'text': 'a', 'lnum': 3, 'filename': b:temp_name}, + \ ], + \ ) |