test(impl): add test
This commit is contained in:
parent
7a8fd2e273
commit
1203550399
3 changed files with 25 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue