diff options
author | ZyX <kp-pav@yandex.ru> | 2017-03-13 19:04:59 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-29 10:08:45 +0300 |
commit | e43de6bb3e1efb58669ab904c5672f4ae87003c0 (patch) | |
tree | a6fbb08c1e95cfd3ee138f072043ccc49fe40585 | |
parent | 368a61c5259384d3c32cef4c482953ec318cf900 (diff) | |
download | rneovim-e43de6bb3e1efb58669ab904c5672f4ae87003c0.tar.gz rneovim-e43de6bb3e1efb58669ab904c5672f4ae87003c0.tar.bz2 rneovim-e43de6bb3e1efb58669ab904c5672f4ae87003c0.zip |
unittests: Add test for tv_dict_set_keys_readonly
-rw-r--r-- | test/unit/eval/typval_spec.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/eval/typval_spec.lua b/test/unit/eval/typval_spec.lua index f81f7561b9..0d894ff8b0 100644 --- a/test/unit/eval/typval_spec.lua +++ b/test/unit/eval/typval_spec.lua @@ -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) |