mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-03-17 21:08:08 +02:00
fix test module
This commit is contained in:
parent
6da4a96289
commit
a679185dad
@ -1,5 +1,10 @@
|
|||||||
local include = require 'utils.test.include'
|
local include = require 'utils.test.include'
|
||||||
|
local matching_path = '^__level__/(.+)$'
|
||||||
|
|
||||||
for name in pairs(_G.package.loaded) do
|
for name in pairs(_G.package.loaded) do
|
||||||
|
name = name:match(matching_path)
|
||||||
|
if name then
|
||||||
|
name = name:sub(1, -5)
|
||||||
include(name .. '_tests')
|
include(name .. '_tests')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -9,6 +9,6 @@ end
|
|||||||
return function(name)
|
return function(name)
|
||||||
local s, e = pcall(require, name)
|
local s, e = pcall(require, name)
|
||||||
if not s and not file_is_missing(e) then
|
if not s and not file_is_missing(e) then
|
||||||
error(e, 2)
|
error(e, 10)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user