From 00a740590445cd67aaec75262552bfdf68c0f6c6 Mon Sep 17 00:00:00 2001 From: ray-x Date: Fri, 3 Sep 2021 02:33:34 +1000 Subject: [PATCH] save file --- lua/tests/go_fmt_spec.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/tests/go_fmt_spec.lua b/lua/tests/go_fmt_spec.lua index 1bc5acc..d941e8d 100644 --- a/lua/tests/go_fmt_spec.lua +++ b/lua/tests/go_fmt_spec.lua @@ -130,17 +130,18 @@ describe("should run gofmt", function() local cmd = " silent exe 'e " .. path .. "'" vim.cmd(cmd) + vim.cmd([[cd %:p:h]]) vim.cmd([[packadd go.nvim]]) require("go").setup({goimport = "gopls", lsp_cfg = true}) vim.wait(2000, function() end) - -- vim.cmd([[cd %:p:h]]) require("go.format").goimport() print("workspaces:", vim.inspect(vim.lsp.buf.list_workspace_folders())) vim.wait(200, function() end) + vim.cmd([[w]]) local fmt = vim.fn.join(vim.fn.readfile(path), "\n") print(vim.inspect(fmt)) eq(expected, fmt)