diff options
Diffstat (limited to 'server/test')
-rw-r--r-- | server/test/crossfile/definition.lua | 25 | ||||
-rw-r--r-- | server/test/full/dirty.lua | 8 |
2 files changed, 32 insertions, 1 deletions
diff --git a/server/test/crossfile/definition.lua b/server/test/crossfile/definition.lua index f49530ea..9310c323 100644 --- a/server/test/crossfile/definition.lua +++ b/server/test/crossfile/definition.lua @@ -89,7 +89,7 @@ function TEST(datas) local sourceVM = lsp:getVM(sourceUri) assert(sourceVM) local sourcePos = (sourceList[1][1] + sourceList[1][2]) // 2 - local positions = core.definition(sourceVM, sourcePos, 'definition', lsp) + local positions = core.definition(sourceVM, sourcePos, 'definition') if positions then assert(founded(targetList, positions)) else @@ -123,6 +123,29 @@ TEST { TEST { { path = 'a.lua', + content = '', + target = {0, 0}, + }, + { + path = 'b.lua', + content = 'require <?"A"?>', + }, +} + +TEST { + { + path = 'a.lua', + content = 'local <!t!> = 1; return <!t!>', + }, + { + path = 'b.lua', + content = 'local <?t?> = require "a"', + }, +} + +TEST { + { + path = 'a.lua', content = [[ local t = { <!x!> = 1, diff --git a/server/test/full/dirty.lua b/server/test/full/dirty.lua index 9c2e65fb..5fe4e998 100644 --- a/server/test/full/dirty.lua +++ b/server/test/full/dirty.lua @@ -5,3 +5,11 @@ a. TEST [[ a: ]] + +TEST [[ +end +]] + +TEST [[ +table.02X +]] |