diff options
-rw-r--r-- | script/workspace/workspace.lua | 1 | ||||
-rw-r--r-- | test/crossfile/definition.lua | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index ea2c4737..529c8936 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -488,6 +488,7 @@ function m.normalize(path) end end) path = util.expandPath(path) + path = path:gsub('^%.[/\\]+', '') if platform.OS == 'Windows' then path = path:gsub('[/\\]+', '\\') :gsub('[/\\]+$', '') diff --git a/test/crossfile/definition.lua b/test/crossfile/definition.lua index 058f5d18..b0cc232f 100644 --- a/test/crossfile/definition.lua +++ b/test/crossfile/definition.lua @@ -867,3 +867,28 @@ print(t.<?x?>) ]] } } + +local originRuntimePath = config.get 'Lua.runtime.path' +config.set('Lua.runtime.path', { + './?.lua' +}) + +TEST { + { + path = 'a.lua', + content = [[ +return { + <!x!> = 1, +} +]], + }, + { + path = 'b.lua', + content = [[ +local t = require 'a' +print(t.<?x?>) + ]] + } +} + +config.set('Lua.runtime.path', originRuntimePath) |