refactor(tests): rewrite using new thing
This commit is contained in:
parent
c4c302ed48
commit
1cb507fa40
5 changed files with 36 additions and 101 deletions
|
|
@ -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 {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue