mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
unittests: Add test for tv_dict_set_keys_readonly
This commit is contained in:
parent
368a61c525
commit
e43de6bb3e
@ -2187,5 +2187,18 @@ describe('typval.c', function()
|
||||
eq(1, d_copy1.dv_refcount)
|
||||
end)
|
||||
end)
|
||||
describe('set_keys_readonly()', function()
|
||||
itp('works', function()
|
||||
local d = dict({a=true})
|
||||
local dis = dict_items(d)
|
||||
alloc_log:check({a.dict(d), a.di(dis.a)})
|
||||
eq(0, bit.band(dis.a.di_flags, lib.DI_FLAGS_RO))
|
||||
eq(0, bit.band(dis.a.di_flags, lib.DI_FLAGS_FIX))
|
||||
lib.tv_dict_set_keys_readonly(d)
|
||||
alloc_log:check({})
|
||||
eq(lib.DI_FLAGS_RO, bit.band(dis.a.di_flags, lib.DI_FLAGS_RO))
|
||||
eq(lib.DI_FLAGS_FIX, bit.band(dis.a.di_flags, lib.DI_FLAGS_FIX))
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user