update
This commit is contained in:
parent
087c4ffa43
commit
88d5ea1528
2 changed files with 4 additions and 9 deletions
|
|
@ -64,7 +64,6 @@ local function build_command(cmd_template, executable, substitutions)
|
||||||
return cmd
|
return cmd
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function ensure_directories()
|
local function ensure_directories()
|
||||||
vim.system({ "mkdir", "-p", "build", "io" }):wait()
|
vim.system({ "mkdir", "-p", "build", "io" }):wait()
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -303,6 +303,10 @@ local function toggle_test_panel()
|
||||||
local prefix = i == test_state.current_index and "> " or " "
|
local prefix = i == test_state.current_index and "> " or " "
|
||||||
local tab = string.format("%s%d.", prefix, i)
|
local tab = string.format("%s%d.", prefix, i)
|
||||||
|
|
||||||
|
if test_case.ok ~= nil then
|
||||||
|
tab = tab .. string.format(" [ok:%-5s]", tostring(test_case.ok))
|
||||||
|
end
|
||||||
|
|
||||||
if test_case.code then
|
if test_case.code then
|
||||||
tab = tab .. string.format(" [code:%-" .. max_code_width .. "s]", tostring(test_case.code))
|
tab = tab .. string.format(" [code:%-" .. max_code_width .. "s]", tostring(test_case.code))
|
||||||
end
|
end
|
||||||
|
|
@ -312,10 +316,6 @@ local function toggle_test_panel()
|
||||||
tab = tab .. string.format(" [time:%-" .. max_time_width .. "s]", time_text)
|
tab = tab .. string.format(" [time:%-" .. max_time_width .. "s]", time_text)
|
||||||
end
|
end
|
||||||
|
|
||||||
if test_case.ok ~= nil then
|
|
||||||
tab = tab .. string.format(" [ok:%-5s]", tostring(test_case.ok))
|
|
||||||
end
|
|
||||||
|
|
||||||
if test_case.signal then
|
if test_case.signal then
|
||||||
tab = tab .. string.format(" [%s]", test_case.signal)
|
tab = tab .. string.format(" [%s]", test_case.signal)
|
||||||
end
|
end
|
||||||
|
|
@ -327,7 +327,6 @@ local function toggle_test_panel()
|
||||||
if current_test then
|
if current_test then
|
||||||
table.insert(tab_lines, "")
|
table.insert(tab_lines, "")
|
||||||
table.insert(tab_lines, "Input:")
|
table.insert(tab_lines, "Input:")
|
||||||
table.insert(tab_lines, "")
|
|
||||||
for _, line in ipairs(vim.split(current_test.input, "\n", { plain = true, trimempty = true })) do
|
for _, line in ipairs(vim.split(current_test.input, "\n", { plain = true, trimempty = true })) do
|
||||||
table.insert(tab_lines, line)
|
table.insert(tab_lines, line)
|
||||||
end
|
end
|
||||||
|
|
@ -336,7 +335,6 @@ local function toggle_test_panel()
|
||||||
return tab_lines
|
return tab_lines
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function update_expected_pane()
|
local function update_expected_pane()
|
||||||
local test_state = test_module.get_test_panel_state()
|
local test_state = test_module.get_test_panel_state()
|
||||||
local current_test = test_state.test_cases[test_state.current_index]
|
local current_test = test_state.test_cases[test_state.current_index]
|
||||||
|
|
@ -347,7 +345,6 @@ local function toggle_test_panel()
|
||||||
|
|
||||||
local expected_lines = {}
|
local expected_lines = {}
|
||||||
table.insert(expected_lines, "Expected:")
|
table.insert(expected_lines, "Expected:")
|
||||||
table.insert(expected_lines, "")
|
|
||||||
|
|
||||||
local expected_text = current_test.expected
|
local expected_text = current_test.expected
|
||||||
for _, line in ipairs(vim.split(expected_text, "\n", { plain = true, trimempty = true })) do
|
for _, line in ipairs(vim.split(expected_text, "\n", { plain = true, trimempty = true })) do
|
||||||
|
|
@ -369,7 +366,6 @@ local function toggle_test_panel()
|
||||||
|
|
||||||
if current_test.actual then
|
if current_test.actual then
|
||||||
table.insert(actual_lines, "Actual:")
|
table.insert(actual_lines, "Actual:")
|
||||||
table.insert(actual_lines, "")
|
|
||||||
for _, line in ipairs(vim.split(current_test.actual, "\n", { plain = true, trimempty = true })) do
|
for _, line in ipairs(vim.split(current_test.actual, "\n", { plain = true, trimempty = true })) do
|
||||||
table.insert(actual_lines, line)
|
table.insert(actual_lines, line)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue