Skip to content

Commit

Permalink
test(utils): get_select to empty file
Browse files Browse the repository at this point in the history
  • Loading branch information
AgatZan committed Nov 9, 2024
1 parent a305d28 commit c3d5628
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_select.lua
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,25 @@ T["param"]["new"]["at_command"] = function(selection_mode, coord)
child.lua_func(getSelectedText, "'>", selection_mode)
)
end
T["new"] = new_set({
hooks = {
pre_case = function()
child.restart({ "-u", "scripts/minimal_init.lua" })
child.api.nvim_buf_set_lines(0, 0, -1, false, {})
getSelectedText = require("scratch.utils").getSelectedText
end,
post_case = function()
child.stop()
end,
},
parametrize = { { 1, 1, 1, 1 } },
})
T["new"]["empty_file"] = function(selection_mode, coord)
select_wise(coord, selection_mode)
MiniTest.expect.equality(
table_select({}, coord, selection_mode),
child.lua_func(getSelectedText, "'>", selection_mode)
)
end

return T

0 comments on commit c3d5628

Please sign in to comment.