fix(struct_tags): edge case with structs declared as var (#99)
* fix(struct_tags): edge case with structs declared as var * test: test it and fix it * fixup! test: test it and fix it * fixup! fix(struct_tags): edge case with structs declared as var * fixup! test: test it and fix it
This commit is contained in:
parent
a993ece59f
commit
969db908f8
7 changed files with 96 additions and 6 deletions
|
|
@ -82,4 +82,30 @@ T["struct_tags"]["should add more than one tag"] = function()
|
|||
t.eq(t.readfile(tmp), fixtures.output)
|
||||
end
|
||||
|
||||
T["struct_tags"]["should add tags on var"] = function()
|
||||
local tmp = t.tmpfile()
|
||||
local fixtures = t.get_fixtures "tags/var"
|
||||
t.writefile(tmp, fixtures.input)
|
||||
|
||||
child.cmd("silent edit " .. tmp)
|
||||
child.fn.setpos(".", { child.fn.bufnr(tmp), 5, 3 })
|
||||
child.cmd "GoTagAdd yaml"
|
||||
child.cmd "write"
|
||||
|
||||
t.eq(t.readfile(tmp), fixtures.output)
|
||||
end
|
||||
|
||||
T["struct_tags"]["should add tags on short declr var"] = function()
|
||||
local tmp = t.tmpfile()
|
||||
local fixtures = t.get_fixtures "tags/svar"
|
||||
t.writefile(tmp, fixtures.input)
|
||||
|
||||
child.cmd("silent edit " .. tmp)
|
||||
child.fn.setpos(".", { child.fn.bufnr(tmp), 4, 3 })
|
||||
child.cmd "GoTagAdd xml"
|
||||
child.cmd "write"
|
||||
|
||||
t.eq(t.readfile(tmp), fixtures.output)
|
||||
end
|
||||
|
||||
return T
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue