From 028460ed338a0ba582e5f755a9734ed65b290c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 16 Dec 2021 20:08:23 +0800 Subject: fix #847 --- test/crossfile/definition.lua | 84 ++++++++++++++++++++++++++++++++----------- 1 file changed, 64 insertions(+), 20 deletions(-) (limited to 'test/crossfile') diff --git a/test/crossfile/definition.lua b/test/crossfile/definition.lua index f44633e1..aa971f3e 100644 --- a/test/crossfile/definition.lua +++ b/test/crossfile/definition.lua @@ -891,25 +891,69 @@ print(t.) } } ---config.set('Lua.runtime.path', { --- '/home/?.lua' ---}) ---TEST { --- { --- path = '/home/a.lua', --- content = [[ ---return { --- = 1, ---} ---]], --- }, --- { --- path = 'b.lua', --- content = [[ ---local t = require 'a' ---print(t.) --- ]] --- } ---} +config.set('Lua.runtime.path', { + '/home/?.lua' +}) +TEST { + { + path = '/home/a.lua', + content = [[ +return { + = 1, +} +]], + }, + { + path = 'b.lua', + content = [[ +local t = require 'a' +print(t.) + ]] + } +} +config.set('Lua.runtime.pathStrict', true) +config.set('Lua.runtime.path', { + './?.lua' +}) +TEST { + { + path = 'a.lua', + content = [[ +return { + = 1, +} +]], + }, + { + path = 'b.lua', + content = [[ +local t = require 'a' +print(t.) + ]] + } +} + +config.set('Lua.runtime.path', { + '/home/?.lua' +}) +TEST { + { + path = '/home/a.lua', + content = [[ +return { + = 1, +} +]], + }, + { + path = 'b.lua', + content = [[ +local t = require 'a' +print(t.) + ]] + } +} + +config.set('Lua.runtime.pathStrict', false) config.set('Lua.runtime.path', originRuntimePath) -- cgit v1.2.3