refactor(tests): rewrite using new thing

This commit is contained in:
Oleksandr Smirnov 2025-03-22 20:04:30 +02:00
parent c4c302ed48
commit 1cb507fa40
No known key found for this signature in database
5 changed files with 36 additions and 101 deletions

View file

@ -11,19 +11,14 @@ local T = MiniTest.new_set {
}
local function do_the_test(fixture, pos)
local tmp = t.tmpfile()
local fixtures = t.get_fixtures("comment/" .. fixture)
t.writefile(tmp, fixtures.input)
child.cmd("silent edit " .. tmp)
child.fn.setpos(".", { child.fn.bufnr "%", unpack(pos) })
local rs = t.setup("comment/" .. fixture, child, pos)
child.cmd "GoCmt"
child.cmd "write"
t.eq(t.readfile(tmp), fixtures.output)
t.eq(t.readfile(rs.tmp), rs.fixtures.output)
-- without it all other(not even from this module) tests are falling
t.deletefile(tmp)
t.deletefile(rs.tmp)
end
T["comment"] = MiniTest.new_set {}