1

Refresh generated neovim config

This commit is contained in:
2024-08-15 13:01:03 +02:00
parent 64b51cf53a
commit f5af8e2b28
1836 changed files with 38979 additions and 31094 deletions

View File

@ -20,7 +20,11 @@ Basic['`string`'] = function()
end
Basic['a metatable'] = function()
return setmetatable({}, {})
return setmetatable({}, {
__tostring = function()
return '{}'
end
})
end
Basic['a thread'] = function()

View File

@ -1,5 +1,12 @@
local M = {}
local promise = require('promise')
local reject = promise.reject
promise.reject = function (reason)
local p = reject(reason)
p.needHandleRejection = nil
return p
end
M.setTimeout = promise.loop.setTimeout

View File

@ -18,12 +18,7 @@ return function(options)
if ok then
return
end
-- Some tests never handle the rejected promises, We should ignore them.
local msg = tostring(res)
if msg:match('^UnhandledPromiseRejection') then
return
end
table.insert(promiseUnhandledError, msg)
table.insert(promiseUnhandledError, tostring(res))
end
return handler
end

View File

@ -69,6 +69,23 @@ describe('EventLoop for Promise.', function()
assert.True(wait())
end)
it('call `nextIdle` in `nextIdle` event', function()
local onIdle = spy.new(function() end)
local onNextIdle = spy.new(function() end)
loop.nextIdle(function()
onIdle()
loop.nextIdle(function()
onNextIdle()
assert.spy(onNextIdle).was_called()
done()
end)
assert.spy(onIdle).was_called()
assert.spy(onNextIdle).was_not_called()
end)
assert.True(wait())
end)
it('override callWrapper method', function()
local rawCallWrapper = loop.callWrapper
local callback = function() end