summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-04-14 20:13:00 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-04-14 20:13:00 +0800
commitede808fe32a66ac828762818bf43d18fc343c159 (patch)
treea4cc8808fff798ea3bfd7103fb56bfb1d74f9c9c /test
parentbabe8e194576b0cd2ede04d98417a5f0e2a23647 (diff)
downloadlua-language-server-ede808fe32a66ac828762818bf43d18fc343c159.zip
stash
Diffstat (limited to 'test')
-rw-r--r--test/basic/linker.lua16
-rw-r--r--test/basic/linker.txt16
2 files changed, 27 insertions, 5 deletions
diff --git a/test/basic/linker.lua b/test/basic/linker.lua
index bf4e50bb..0be93e8d 100644
--- a/test/basic/linker.lua
+++ b/test/basic/linker.lua
@@ -37,24 +37,28 @@ local function TEST(script)
end
CARE['id'] = true
+CARE['loc'] = true
TEST [[
local <?x?>
]] {
- id = '9',
+ id = '9',
+ loc = true,
}
TEST [[
local x
print(<?x?>)
]] {
- id = '7',
+ id = '7',
+ loc = true,
}
TEST [[
local x
<?x?> = 1
]] {
- id = '7',
+ id = '7',
+ loc = true,
}
CARE['global'] = true
@@ -76,14 +80,16 @@ TEST [[
local x
print(x.y.<?z?>)
]] {
- id = '7|"y"|"z"',
+ id = '7|"y"|"z"',
+ loc = true,
}
TEST [[
local x
function x:<?f?>() end
]] {
- id = '7|"f"',
+ id = '7|"f"',
+ loc = true,
}
TEST [[
diff --git a/test/basic/linker.txt b/test/basic/linker.txt
new file mode 100644
index 00000000..18176369
--- /dev/null
+++ b/test/basic/linker.txt
@@ -0,0 +1,16 @@
+ast -> linkers = {
+ globals = {
+ ['"X"|"Y"|"Z"'] = {src1, src2, src3},
+ ['"X"|"Y"'] = {src4, src5, src6},
+ ['"X"'] = {src7, src8, src9},
+ },
+ locals = {
+ ['7'] = {src10},
+ ['7|"x"'] = {src11},
+ },
+ tfield = {
+ ['11|"k"'] = {src12},
+ },
+}
+
+