From a765508e2e6a0ae0d05ee2076ddd8ea116e16e16 Mon Sep 17 00:00:00 2001 From: ray-x Date: Fri, 9 Feb 2024 21:01:20 +1100 Subject: [PATCH] vim.wait --- lua/tests/go_gopls_spec.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/tests/go_gopls_spec.lua b/lua/tests/go_gopls_spec.lua index 9dcae0f..daca69a 100644 --- a/lua/tests/go_gopls_spec.lua +++ b/lua/tests/go_gopls_spec.lua @@ -69,7 +69,7 @@ describe('should run gopls releated functions', function() local fmt require('go.utils').log('waiting for import') vim.cmd([[wa]]) - vim.wait(2000, function() + local success = vim.wait(2000, function() fmt = vim.fn.join(vim.fn.readfile(path), '\n') require('go.utils').log(vim.inspect(fmt)) if expected == fmt then @@ -77,11 +77,11 @@ describe('should run gopls releated functions', function() end return false end, 200) - if expected == fmt then + if success then eq(1, 1) - return + else + eq(expected, fmt) end - eq(1, 1) -- still not working cmd = 'bd! ' .. path vim.cmd(cmd) end)