Skip to content

Commit

Permalink
always always red
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesmithgh committed Dec 6, 2023
1 parent 4bd723b commit c4a0a1f
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions tests/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ M.kitty_remote_send_text_cmd = function(txt)
end

M.kitty_remote_send_text = function(txt, ...)
local result = vim.system(M.kitty_remote_send_text_cmd(txt), ...):wait()
M.debug(result)
return result
return M.debug(vim.system(M.kitty_remote_send_text_cmd(txt), ...):wait())
end

M.kitty_remote_set_title_cmd = function(title)
Expand All @@ -72,9 +70,7 @@ M.kitty_remote_close_window_cmd = function()
end

M.kitty_remote_close_window = function()
local result = vim.system(M.kitty_remote_close_window_cmd()):wait()
M.debug(result)
return result
return M.debug(vim.system(M.kitty_remote_close_window_cmd()):wait())
end

M.kitty_remote_ls_cmd = function()
Expand Down Expand Up @@ -129,10 +125,11 @@ M.pause = function(delay)
end

M.kitty_remote_kitten_kitty_scroll_prompt_and_pause = function(direction, select_cmd_output, ...)
local result = vim
.system(M.kitty_remote_kitten_kitty_scroll_prompt_cmd(direction, select_cmd_output), ...)
:wait()
M.debug(result)
local result = M.debug(
vim
.system(M.kitty_remote_kitten_kitty_scroll_prompt_cmd(direction, select_cmd_output), ...)
:wait()
)
M.pause(1)
return result
end
Expand Down Expand Up @@ -232,20 +229,21 @@ M.feed_kitty = function(input)
end
M.pause(6) -- longer pause for linux

local result = M.kitty_remote_get_text()
M.debug(result)
local result = M.debug(M.kitty_remote_get_text())
return result.stdout
end

M.assert_screen_equals = function(actual, expected, ...)
local actual_rstrip = actual:gsub('%s*\n', '\n')
local expected_rstrip = expected:gsub('%s*\n', '\n')
M.debug('actual')
M.debug('actual length: ' .. #actual_rstrip)
M.debug(actual_rstrip)
M.debug('expected')
M.debug('expected length: ' .. #expected_rstrip)
M.debug(expected_rstrip)
M.debug({
actual = actual,
actual_rstrip = actual_rstrip,
actual_length = #actual,
expected = expected,
expected_rstrip = expected_rstrip,
expected_length = #expected,
})
assert(actual_rstrip == expected_rstrip, ...)
end

Expand Down

0 comments on commit c4a0a1f

Please sign in to comment.