diff --git a/spec/fixtures/tags/add_input.go b/spec/fixtures/tags/add_input.go deleted file mode 100644 index 7e27a27..0000000 --- a/spec/fixtures/tags/add_input.go +++ /dev/null @@ -1,11 +0,0 @@ -package main - -type Test struct { - ID int - Name string - Num int64 - Another struct { - First int - Second string - } -} diff --git a/spec/fixtures/tags/add_output.go b/spec/fixtures/tags/add_output.go deleted file mode 100644 index eaba62f..0000000 --- a/spec/fixtures/tags/add_output.go +++ /dev/null @@ -1,11 +0,0 @@ -package main - -type Test struct { - ID int `json:"id"` - Name string `json:"name"` - Num int64 `json:"num"` - Another struct { - First int `json:"first"` - Second string `json:"second"` - } `json:"another"` -} diff --git a/spec/fixtures/tags/remove_input.go b/spec/fixtures/tags/remove_input.go deleted file mode 100644 index eaba62f..0000000 --- a/spec/fixtures/tags/remove_input.go +++ /dev/null @@ -1,11 +0,0 @@ -package main - -type Test struct { - ID int `json:"id"` - Name string `json:"name"` - Num int64 `json:"num"` - Another struct { - First int `json:"first"` - Second string `json:"second"` - } `json:"another"` -} diff --git a/spec/fixtures/tags/remove_output.go b/spec/fixtures/tags/remove_output.go deleted file mode 100644 index 7e27a27..0000000 --- a/spec/fixtures/tags/remove_output.go +++ /dev/null @@ -1,11 +0,0 @@ -package main - -type Test struct { - ID int - Name string - Num int64 - Another struct { - First int - Second string - } -} diff --git a/spec/integration/struct_tags_spec.lua b/spec/integration/struct_tags_spec.lua deleted file mode 100644 index 5fd6ff8..0000000 --- a/spec/integration/struct_tags_spec.lua +++ /dev/null @@ -1,43 +0,0 @@ -local cur_dir = vim.fn.expand "%:p:h" - -describe("gopher.struct_tags", function() - it("can add json tag to struct", function() - local tag = require "gopher.struct_tags" - local temp_file = vim.fn.tempname() .. ".go" - local input_file = vim.fn.readfile(cur_dir .. "/spec/fixtures/tags/add_input.go") - local output_file = vim.fn.join(vim.fn.readfile(cur_dir .. "/spec/fixtures/tags/add_output.go"), "\n") - - vim.fn.writefile(input_file, temp_file) - vim.cmd("silent exe 'e " .. temp_file .. "'") - vim.bo.filetype = "go" - - local bufn = vim.fn.bufnr(0) - vim.fn.setpos(".", { bufn, 3, 6, 0 }) - tag.add() - - vim.wait(100) - assert.are.same(output_file, vim.fn.join(vim.fn.readfile(temp_file), "\n")) - - vim.cmd("bd! " .. temp_file) - end) - - it("can remove json tag from struct", function() - local tag = require "gopher.struct_tags" - local temp_file = vim.fn.tempname() .. ".go" - local input_file = vim.fn.readfile(cur_dir .. "/spec/fixtures/tags/remove_input.go") - local output_file = vim.fn.join(vim.fn.readfile(cur_dir .. "/spec/fixtures/tags/remove_output.go"), "\n") - - vim.fn.writefile(input_file, temp_file) - vim.cmd("silent exe 'e " .. temp_file .. "'") - vim.bo.filetype = "go" - - local bufn = vim.fn.bufnr() - vim.fn.setpos(".", { bufn, 3, 6, 0 }) - tag.remove() - - vim.wait(100) - assert.are.same(output_file, vim.fn.join(vim.fn.readfile(temp_file), "\n")) - - vim.cmd("bd! " .. temp_file) - end) -end)