From c3ecdcdb10c0a239b893dc2129ba43550310289f Mon Sep 17 00:00:00 2001 From: ray-x Date: Fri, 9 Feb 2024 21:25:51 +1100 Subject: [PATCH] wait4 --- lua/tests/go_gopls_spec.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lua/tests/go_gopls_spec.lua b/lua/tests/go_gopls_spec.lua index 8d555b3..67a0372 100644 --- a/lua/tests/go_gopls_spec.lua +++ b/lua/tests/go_gopls_spec.lua @@ -32,11 +32,16 @@ describe('should run gopls releated functions', function() vim.wait(200, function() return false end) - + local fmt print('workspaces:', vim.inspect(vim.lsp.buf.list_workspace_folders())) - vim.wait(1000, function() return true end) + vim.wait(2000, function() + fmt = vim.fn.join(vim.fn.readfile(path), '\n') + if expected == fmt then + return true + end + return false + end, 200) vim.cmd([[wa]]) - local fmt = vim.fn.join(vim.fn.readfile(path), '\n') require('go.utils').log('fmt', vim.inspect(fmt), 'expected', vim.inspect(expected)) eq(expected, fmt) -- eq(1, 1) -- still not working