diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-24 10:17:09 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-24 10:17:09 +0800 |
commit | 6597f469276880db153b301da3daf7a79bd2f98e (patch) | |
tree | f692703e0d5eec6fa2aab06d6a7d2d711228b0d5 /test | |
parent | 5fafca581ed16986f8f6244a613d20897b74872c (diff) | |
download | lua-language-server-6597f469276880db153b301da3daf7a79bd2f98e.zip |
fix #263 fix test failure in Linux and macOS
Diffstat (limited to 'test')
-rw-r--r-- | test/completion/init.lua | 2 | ||||
-rw-r--r-- | test/crossfile/completion.lua | 23 | ||||
-rw-r--r-- | test/crossfile/hover.lua | 17 |
3 files changed, 42 insertions, 0 deletions
diff --git a/test/completion/init.lua b/test/completion/init.lua index b5eac60b..b117e4d8 100644 --- a/test/completion/init.lua +++ b/test/completion/init.lua @@ -1236,10 +1236,12 @@ loadstring$ { label = 'loadstring', kind = define.CompletionItemKind.Function, + deprecated = true, }, { label = 'loadstring()', kind = define.CompletionItemKind.Snippet, + deprecated = true, }, } diff --git a/test/crossfile/completion.lua b/test/crossfile/completion.lua index 6ac45c29..67c6d9e6 100644 --- a/test/crossfile/completion.lua +++ b/test/crossfile/completion.lua @@ -526,6 +526,7 @@ TEST { } } +if require 'bee.platform'.OS == 'Windows' then TEST { { path = [[abc/init.lua]], @@ -546,6 +547,28 @@ TEST { }, } } +else +TEST { + { + path = [[abc/init.lua]], + content = '' + }, + { + path = 'main.lua', + content = [[ + dofile 'ab$' + ]], + main = true, + }, + completion = { + { + label = [[abc/init.lua]], + kind = CompletionItemKind.Reference, + textEdit = EXISTS, + }, + } +} +end Cared['description'] = true TEST { diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua index 9fc21461..715d658f 100644 --- a/test/crossfile/hover.lua +++ b/test/crossfile/hover.lua @@ -90,6 +90,7 @@ TEST { } } +if require 'bee.platform'.OS == 'Windows' then TEST { { path = 'Folder/a.lua', @@ -104,6 +105,22 @@ TEST { description = [[* [Folder\a.lua](file:///Folder/a.lua) (假设搜索路径包含 `Folder\?.lua`)]], } } +else +TEST { + { + path = 'Folder/a.lua', + content = '', + }, + { + path = 'b.lua', + content = 'require <?"a"?>', + }, + hover = { + label = '1 个字节', + description = [[* [Folder/a.lua](file:///Folder/a.lua) (假设搜索路径包含 `Folder/?.lua`)]], + } +} +end TEST { { |