|
|
@ -29,12 +29,20 @@ describe('should run fillstruct', function()
|
|
|
|
|
|
|
|
|
|
|
|
require('go.reftool').fillstruct()
|
|
|
|
require('go.reftool').fillstruct()
|
|
|
|
|
|
|
|
|
|
|
|
vim.cmd('sleep 2000m') -- allow cleanup
|
|
|
|
local filled, fmt
|
|
|
|
vim.cmd('sleep 2000m') -- allow cleanup
|
|
|
|
for _ = 1, 6 do
|
|
|
|
vim.cmd('write')
|
|
|
|
require('go.utils').log('waiting for fill')
|
|
|
|
local filled = vim.api.nvim_buf_get_lines(0, 0, 40, false)
|
|
|
|
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)
|
|
|
|
eq(expected, filled)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|