diff options
author | w0rp <devw0rp@gmail.com> | 2017-09-04 00:09:46 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-09-04 00:15:13 +0100 |
commit | e53debe000e9419108469dd30c79fa8c99b4a4f0 (patch) | |
tree | 659f7816a7d2c8219bfe18ad8404988095ca0630 /test/lsp | |
parent | c2f547b6e3ff511cb2ca64e6f7832cf95d6eb80f (diff) | |
download | ale-e53debe000e9419108469dd30c79fa8c99b4a4f0.zip |
Fix #907 - Stop LSP integration breaking with empty string keys in NeoVim
Diffstat (limited to 'test/lsp')
-rw-r--r-- | test/lsp/test_lsp_connections.vader | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/lsp/test_lsp_connections.vader b/test/lsp/test_lsp_connections.vader index 1faa7a03..5549b1f7 100644 --- a/test/lsp/test_lsp_connections.vader +++ b/test/lsp/test_lsp_connections.vader @@ -3,6 +3,7 @@ Before: After: unlet! b:data + unlet! b:conn Execute(GetNextMessageID() should increment appropriately): " We should get the initial ID, and increment a bit. @@ -220,3 +221,51 @@ Execute(ale#lsp#ReadMessageData() should handle a message with part of a second \ . '{"id":2,"jsonrpc":"2.0","result":{"foo":"barÜ"}}' \ . b:data \ ) + +Execute(Projects with regular project roots should be registered correctly): + let b:conn = {'projects': {}} + + call ale#lsp#RegisterProject(b:conn, '/foo/bar') + + AssertEqual + \ { + \ 'projects': { + \ '/foo/bar': {'initialized': 0, 'message_queue': [], 'init_request_id': 0}, + \ }, + \ }, + \ b:conn + +Execute(Projects with regular project roots should be fetched correctly): + let b:conn = { + \ 'projects': { + \ '/foo/bar': {'initialized': 0, 'message_queue': [], 'init_request_id': 0}, + \ }, + \} + + AssertEqual + \ {'initialized': 0, 'message_queue': [], 'init_request_id': 0}, + \ ale#lsp#GetProject(b:conn, '/foo/bar') + +Execute(Projects with empty project roots should be registered correctly): + let b:conn = {'projects': {}} + + call ale#lsp#RegisterProject(b:conn, '') + + AssertEqual + \ { + \ 'projects': { + \ '<<EMPTY>>': {'initialized': 1, 'message_queue': [], 'init_request_id': 0}, + \ }, + \ }, + \ b:conn + +Execute(Projects with empty project roots should be fetched correctly): + let b:conn = { + \ 'projects': { + \ '<<EMPTY>>': {'initialized': 1, 'message_queue': [], 'init_request_id': 0}, + \ }, + \} + + AssertEqual + \ {'initialized': 1, 'message_queue': [], 'init_request_id': 0}, + \ ale#lsp#GetProject(b:conn, '') |