1
0
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:
RedRafe 2024-10-18 16:33:16 +02:00
parent 6da4a96289
commit a679185dad
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,10 @@
local include = require 'utils.test.include'
local matching_path = '^__level__/(.+)$'
for name in pairs(_G.package.loaded) do
include(name .. '_tests')
name = name:match(matching_path)
if name then
name = name:sub(1, -5)
include(name .. '_tests')
end
end

View File

@ -9,6 +9,6 @@ end
return function(name)
local s, e = pcall(require, name)
if not s and not file_is_missing(e) then
error(e, 2)
error(e, 10)
end
end