Skip to content

Commit

Permalink
gopls fill
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-x committed Nov 1, 2023
1 parent 5f0528b commit a6feffc
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions lua/tests/go_fillstruct_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,20 @@ describe('should run fillstruct', function()

require('go.reftool').fillstruct()

vim.cmd('sleep 2000m') -- allow cleanup
vim.cmd('sleep 2000m') -- allow cleanup
vim.cmd('write')
local filled = vim.api.nvim_buf_get_lines(0, 0, 40, false)
local filled, fmt
for _ = 1, 6 do
require('go.utils').log('waiting for fill')
vim.wait(1000, function() return false end)
vim.cmd([[wa]])

filled = vim.api.nvim_buf_get_lines(0, 0, 40, false)
fmt = vim.fn.join(vim.fn.readfile(path), '\n')
require('go.utils').log(vim.inspect(fmt))
if expected == filled then
break
end
end

filled = vim.fn.join(filled, '\n')
eq(expected, filled)
end)
end)

0 comments on commit a6feffc

Please sign in to comment.