mirror of
https://github.com/pesde-pkg/scripts.git
synced 2025-01-07 12:09:09 +00:00
style: apply stylua formatter
This commit is contained in:
parent
be2ae619c6
commit
0045c01c72
7 changed files with 383 additions and 385 deletions
|
@ -62,7 +62,6 @@ for _, test in discoverTests("src") do
|
||||||
or table.find(allowedTests, baseName)
|
or table.find(allowedTests, baseName)
|
||||||
or table.find(allowedTests, baseNameWithoutExt)
|
or table.find(allowedTests, baseNameWithoutExt)
|
||||||
|
|
||||||
|
|
||||||
local constructors = {
|
local constructors = {
|
||||||
case = frktest.test.case,
|
case = frktest.test.case,
|
||||||
suite = frktest.test.suite,
|
suite = frktest.test.suite,
|
||||||
|
|
|
@ -11,7 +11,8 @@ local STYLE = table.freeze({
|
||||||
end,
|
end,
|
||||||
|
|
||||||
report = function(name: string, state: "success" | "error" | "skip", elapsed: number)
|
report = function(name: string, state: "success" | "error" | "skip", elapsed: number)
|
||||||
local state_color: stdio.Color = if state == "success" then "green"
|
local state_color: stdio.Color = if state == "success"
|
||||||
|
then "green"
|
||||||
elseif state == "error" then "red"
|
elseif state == "error" then "red"
|
||||||
elseif state == "skip" then "yellow"
|
elseif state == "skip" then "yellow"
|
||||||
else error("Invalid test state")
|
else error("Invalid test state")
|
||||||
|
@ -39,15 +40,13 @@ function ReporterExt.init()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
frktest.test.on_test_leave(function(test)
|
frktest.test.on_test_leave(function(test)
|
||||||
print(
|
print(STYLE.report(
|
||||||
STYLE.report(
|
|
||||||
test.name,
|
test.name,
|
||||||
if test.failed then "error" else "success",
|
if test.failed then "error" else "success",
|
||||||
|
|
||||||
-- Await receival of the timestamp and convert the difference to ms
|
-- Await receival of the timestamp and convert the difference to ms
|
||||||
(os.clock() - recv_ts()) * 1000
|
(os.clock() - recv_ts()) * 1000
|
||||||
)
|
))
|
||||||
)
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
frktest.test.on_test_skipped(function(test)
|
frktest.test.on_test_skipped(function(test)
|
||||||
|
|
Loading…
Reference in a new issue