Fixed removing of the test.lua file.

This commit is contained in:
Robert Zenz 2014-12-21 12:17:22 +01:00
parent 1851e83ad4
commit f38d6bbc3a

View File

@ -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