all repos

gopher.nvim @ d6b41494f1ad76a5b1cf442b2f0531499ace08e0

Minimalistic plugin for Go development
1 files changed, 4 insertions(+), 0 deletions(-)
fix(testutils): validate provided cursor position
Author: Oleksandr Smirnov olexsmir@gmail.com
Committed at: 2025-08-30 16:59:50 +0300
Change ID: zywnyysrqztzqopsqkrzrtuwqzqlkqpr
Parent: b6d3815
M spec/testutils.lua

@@ -78,6 +78,8 @@ ---@param child MiniTest.child

---@param pos? number[] ---@return gopher.TestUtilsSetup function testutils.setup_test(fixture, child, pos) + vim.validate("pos", pos, "table", true) + local tmp = testutils.tmpfile() local fixtures = testutils.get_fixtures(fixture)

@@ -86,6 +88,8 @@ child.cmd("silent edit " .. tmp)

local bufnr = child.fn.bufnr(tmp) if pos then + assert(#pos == 2, "invalid cursor position") + child.fn.setpos(".", { bufnr, unpack(pos) }) end