summaryrefslogtreecommitdiff
path: root/test/lsp
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-09-04 00:09:46 +0100
committerw0rp <devw0rp@gmail.com>2017-09-04 00:15:13 +0100
commite53debe000e9419108469dd30c79fa8c99b4a4f0 (patch)
tree659f7816a7d2c8219bfe18ad8404988095ca0630 /test/lsp
parentc2f547b6e3ff511cb2ca64e6f7832cf95d6eb80f (diff)
downloadale-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.vader49
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, '')