diff --git a/utils/test.lua b/utils/test.lua index 7094a90..03ddd4b 100644 --- a/utils/test.lua +++ b/utils/test.lua @@ -72,18 +72,17 @@ function test.run(name, test_method) print("Passed (" .. tostring(time) .. " ms)") else local indentation = string.rep(" ", 25) - local newline_index = string.find(err, "\n") local testlua_index = string.find(err, "test.lua:") local message = err - if newline_index ~= nil and testlua_index ~= nil and testlua_index < newline_index then - message = string.sub(message, newline_index + 1) + if testlua_index ~= nil and testlua_index >= 0 then + message = string.sub(message, testlua_index + 13) end message = string.gsub(message, "\n", "\n" .. indentation) - print(message) + print("Failed: " .. message) end end