diff --git a/spec/fixtures/tags/remove_output.go b/spec/fixtures/tags/remove_output.go index 7e27a27..6d9fe70 100644 --- a/spec/fixtures/tags/remove_output.go +++ b/spec/fixtures/tags/remove_output.go @@ -1,11 +1,11 @@ package main type Test struct { - ID int - Name string - Num int64 + ID int + Name string + Num int64 Another struct { - First int - Second string - } + First int + Second string + } } diff --git a/spec/integration/struct_tags_test.lua b/spec/integration/struct_tags_test.lua index e73cfbc..b0b1344 100644 --- a/spec/integration/struct_tags_test.lua +++ b/spec/integration/struct_tags_test.lua @@ -10,7 +10,7 @@ local T = MiniTest.new_set { }, } T["struct_tags"] = MiniTest.new_set {} -T["struct_tags"][".add"] = function() +T["struct_tags"]["add"] = function() local tmp = t.tmpfile() local fixtures = t.fixtures.read "tags/add" t.fixtures.write(tmp, fixtures.input) @@ -22,4 +22,16 @@ T["struct_tags"][".add"] = function() t.eq(t.readfile(tmp), fixtures.output) end +T["struct_tags"]["remove"] = function() + local tmp = t.tmpfile() + local fixtures = t.fixtures.read "tags/remove" + t.fixtures.write(tmp, fixtures.input) + + child.cmd("silent edit " .. tmp) + child.fn.setpos(".", { child.fn.bufnr "%", 4, 6, 0 }) + child.cmd "GoTagRm json" + + t.eq(t.readfile(tmp), fixtures.output) +end + return T