test(impl): add test

This commit is contained in:
Oleksandr Smirnov 2025-02-17 20:16:56 +02:00
parent 7a8fd2e273
commit 1203550399
No known key found for this signature in database
3 changed files with 25 additions and 0 deletions

View file

@ -10,5 +10,19 @@ local T = MiniTest.new_set {
},
}
T["impl"] = MiniTest.new_set {}
T["impl"]["works"] = function()
local tmp = t.tmpfile()
local fixtures = t.fixtures.read "impl/impl"
t.fixtures.write(tmp, fixtures.input)
child.cmd("silent edit " .. tmp)
child.fn.setpos(".", { child.fn.bufnr "%", 3, 6, 0 })
child.cmd "GoImpl w io.Writer"
child.cmd "write"
-- since "impl" won't implement interface if it's already implemented i went with this hack
local rhs = fixtures.output:gsub("Tester2", "Tester")
t.eq(t.readfile(tmp), rhs)
end
return T