diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-06-11 17:51:25 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-06-11 17:51:25 +0800 |
commit | e66956e016a2f9ab635d00a9cb8b2d4bb99bc3a2 (patch) | |
tree | 678ab743bf720b506e931ad8ad4e2c84960f65eb /test/crossfile | |
parent | 62dee501181ebfa374c827df5a15ea9461f38b73 (diff) | |
download | lua-language-server-e66956e016a2f9ab635d00a9cb8b2d4bb99bc3a2.zip |
split all reference
Diffstat (limited to 'test/crossfile')
-rw-r--r-- | test/crossfile/allreferences.lua | 216 | ||||
-rw-r--r-- | test/crossfile/references.lua | 216 |
2 files changed, 216 insertions, 216 deletions
diff --git a/test/crossfile/allreferences.lua b/test/crossfile/allreferences.lua new file mode 100644 index 00000000..056fa416 --- /dev/null +++ b/test/crossfile/allreferences.lua @@ -0,0 +1,216 @@ + +TEST { + { + path = 'a.lua', + content = [[ + local <!f!> = require 'lib' + ]], + }, + { + path = 'lib.lua', + content = [[ + return <~function~> () + end + ]], + target = {22, 50}, + }, +} + +TEST { + { + path = 'a.lua', + content = [[ + local m = {} + function m.<?func?>() + end + return m + ]], + }, + { + path = 'b.lua', + content = [[ + local t = require 'a' + t.<!func!>() + ]], + }, +} + +TEST { + { + path = 'a.lua', + content = [[ + return <?function () end?> + ]], + }, + { + path = 'b.lua', + content = [[ + local t = require 'a' + ]], + }, + { + path = 'b.lua', + content = [[ + local t = require 'a' + ]], + }, + { + path = 'b.lua', + content = [[ + local t = require 'a' + ]], + }, + { + path = 'b.lua', + content = [[ + local <!t!> = require 'a' + ]], + }, +} + +TEST { + { + path = 'a.lua', + content = [[ + local function <?f?>() + end + + return { + <!f!> = <!f!>, + } + ]] + }, + { + path = 'b.lua', + content = [[ + local t = require 'a' + local <!f!> = t.<!f!> + + <!f!>() + + return { + <!f!> = <!f!>, + } + ]] + } +} + +TEST { + { + path = 'a.lua', + content = [[ + local function <!f!>() + end + + return { + <!f!> = <!f!>, + } + ]] + }, + { + path = 'c.lua', + content = [[ + local t = require 'a' + local <!f!> = t.<!f!> + + <!f!>() + + return { + <!f!> = <!f!>, + } + ]] + }, + { + path = 'b.lua', + content = [[ + local t = require 'a' + local <!f!> = t.<!f!> + + <?f?>() + + return { + <!f!> = <!f!>, + } + ]] + } +} + +TEST { + { + path = 'a.lua', + content = [[ + local function <?f?>() + end + + return { + <!f!> = <!f!>, + } + ]] + }, + { + path = 'b1.lua', + content = [[ + local t = require 'a' + t.<!f!>() + ]] + }, + { + path = 'b2.lua', + content = [[ + local t = require 'a' + t.<!f!>() + ]] + }, + { + path = 'b3.lua', + content = [[ + local t = require 'a' + t.<!f!>() + ]] + }, + { + path = 'b4.lua', + content = [[ + local t = require 'a' + t.<!f!>() + ]] + }, + { + path = 'b5.lua', + content = [[ + local t = require 'a' + t.<!f!>() + ]] + }, + { + path = 'b6.lua', + content = [[ + local t = require 'a' + t.<!f!>() + ]] + }, + { + path = 'b7.lua', + content = [[ + local t = require 'a' + t.<!f!>() + ]] + }, +} + +TEST { + { + path = 'a.lua', + content = [[ + local <?t?> = require 'b' + return <!t!> + ]] + }, + { + path = 'b.lua', + content = [[ + local <!t!> = require 'a' + return <!t!> + ]] + }, +} diff --git a/test/crossfile/references.lua b/test/crossfile/references.lua index 66abd4e3..0a6f0b57 100644 --- a/test/crossfile/references.lua +++ b/test/crossfile/references.lua @@ -152,23 +152,6 @@ TEST { { path = 'a.lua', content = [[ - local <!f!> = require 'lib' - ]], - }, - { - path = 'lib.lua', - content = [[ - return <~function~> () - end - ]], - target = {22, 50}, - }, -} - -TEST { - { - path = 'a.lua', - content = [[ <!ROOT!> = 1 ]], }, @@ -199,58 +182,6 @@ TEST { { path = 'a.lua', content = [[ - local m = {} - function m.<?func?>() - end - return m - ]], - }, - { - path = 'b.lua', - content = [[ - local t = require 'a' - t.<!func!>() - ]], - }, -} - -TEST { - { - path = 'a.lua', - content = [[ - return <?function () end?> - ]], - }, - { - path = 'b.lua', - content = [[ - local t = require 'a' - ]], - }, - { - path = 'b.lua', - content = [[ - local t = require 'a' - ]], - }, - { - path = 'b.lua', - content = [[ - local t = require 'a' - ]], - }, - { - path = 'b.lua', - content = [[ - local <!t!> = require 'a' - ]], - }, -} - -TEST { - { - path = 'a.lua', - content = [[ local f = require 'lib' local <?o?> = f() ]], @@ -264,150 +195,3 @@ TEST { ]], }, } - -TEST { - { - path = 'a.lua', - content = [[ - local function <?f?>() - end - - return { - <!f!> = <!f!>, - } - ]] - }, - { - path = 'b.lua', - content = [[ - local t = require 'a' - local <!f!> = t.<!f!> - - <!f!>() - - return { - <!f!> = <!f!>, - } - ]] - } -} - -TEST { - { - path = 'a.lua', - content = [[ - local function <!f!>() - end - - return { - <!f!> = <!f!>, - } - ]] - }, - { - path = 'c.lua', - content = [[ - local t = require 'a' - local <!f!> = t.<!f!> - - <!f!>() - - return { - <!f!> = <!f!>, - } - ]] - }, - { - path = 'b.lua', - content = [[ - local t = require 'a' - local <!f!> = t.<!f!> - - <?f?>() - - return { - <!f!> = <!f!>, - } - ]] - } -} - -TEST { - { - path = 'a.lua', - content = [[ - local function <?f?>() - end - - return { - <!f!> = <!f!>, - } - ]] - }, - { - path = 'b1.lua', - content = [[ - local t = require 'a' - t.<!f!>() - ]] - }, - { - path = 'b2.lua', - content = [[ - local t = require 'a' - t.<!f!>() - ]] - }, - { - path = 'b3.lua', - content = [[ - local t = require 'a' - t.<!f!>() - ]] - }, - { - path = 'b4.lua', - content = [[ - local t = require 'a' - t.<!f!>() - ]] - }, - { - path = 'b5.lua', - content = [[ - local t = require 'a' - t.<!f!>() - ]] - }, - { - path = 'b6.lua', - content = [[ - local t = require 'a' - t.<!f!>() - ]] - }, - { - path = 'b7.lua', - content = [[ - local t = require 'a' - t.<!f!>() - ]] - }, -} - -TEST { - { - path = 'a.lua', - content = [[ - local <?t?> = require 'b' - return <!t!> - ]] - }, - { - path = 'b.lua', - content = [[ - local <!t!> = require 'a' - return <!t!> - ]] - }, -} |