THe first line is now only removed if it contins the test.lua file.
This commit is contained in:
parent
a654d264a4
commit
13fb65f456
@ -69,7 +69,15 @@ function test.run(name, test_method)
|
|||||||
print("Passed")
|
print("Passed")
|
||||||
else
|
else
|
||||||
local indentation = string.rep(" ", 25)
|
local indentation = string.rep(" ", 25)
|
||||||
local message = string.sub(err, string.find(err, "\n") + 1)
|
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)
|
||||||
|
end
|
||||||
|
|
||||||
message = string.gsub(message, "\n", "\n" .. indentation)
|
message = string.gsub(message, "\n", "\n" .. indentation)
|
||||||
|
|
||||||
print(message)
|
print(message)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user