diff options
author | ZyX <kp-pav@yandex.ru> | 2017-12-24 02:41:34 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-12-24 14:09:36 +0300 |
commit | ac55558c97d02f18b9a99cf2dd279451481c4a2f (patch) | |
tree | 699426348587c2604d8eae377c0b0a5af8e44c4d /test | |
parent | 608c3d7baf2745b188bc42f9f45ad1bb188a4828 (diff) | |
download | rneovim-ac55558c97d02f18b9a99cf2dd279451481c4a2f.tar.gz rneovim-ac55558c97d02f18b9a99cf2dd279451481c4a2f.tar.bz2 rneovim-ac55558c97d02f18b9a99cf2dd279451481c4a2f.zip |
eval/typval: Make tv_list_item_remove return pointer to the next item
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/eval/typval_spec.lua | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/unit/eval/typval_spec.lua b/test/unit/eval/typval_spec.lua index 0536839b71..35b5596c63 100644 --- a/test/unit/eval/typval_spec.lua +++ b/test/unit/eval/typval_spec.lua @@ -138,19 +138,19 @@ describe('typval.c', function() a.li(lis[7]), }) - lib.tv_list_item_remove(l, lis[1]) + eq(lis[2], lib.tv_list_item_remove(l, lis[1])) alloc_log:check({ a.freed(table.remove(lis, 1)), }) eq(lis, list_items(l)) - lib.tv_list_item_remove(l, lis[6]) + eq(lis[7], lib.tv_list_item_remove(l, lis[6])) alloc_log:check({ a.freed(table.remove(lis)), }) eq(lis, list_items(l)) - lib.tv_list_item_remove(l, lis[3]) + eq(lis[4], lib.tv_list_item_remove(l, lis[3])) alloc_log:check({ a.freed(table.remove(lis, 3)), }) @@ -174,21 +174,21 @@ describe('typval.c', function() local strings = map(function(li) return li.li_tv.vval.v_string end, lis) - lib.tv_list_item_remove(l, lis[1]) + eq(lis[2], lib.tv_list_item_remove(l, lis[1])) alloc_log:check({ a.freed(table.remove(strings, 1)), a.freed(table.remove(lis, 1)), }) eq(lis, list_items(l)) - lib.tv_list_item_remove(l, lis[2]) + eq(lis[3], lib.tv_list_item_remove(l, lis[2])) alloc_log:check({ a.freed(table.remove(strings, 2)), a.freed(table.remove(lis, 2)), }) eq(lis, list_items(l)) - lib.tv_list_item_remove(l, lis[2]) + eq(nil, lib.tv_list_item_remove(l, lis[2])) alloc_log:check({ a.freed(table.remove(strings, 2)), a.freed(table.remove(lis, 2)), @@ -216,19 +216,19 @@ describe('typval.c', function() a.li(lis[7]), }) - lib.tv_list_item_remove(l, lis[4]) + eq(lis[5], lib.tv_list_item_remove(l, lis[4])) alloc_log:check({a.freed(lis[4])}) eq({lis[1], lis[5], lis[7]}, {lws[1].lw_item, lws[2].lw_item, lws[3].lw_item}) - lib.tv_list_item_remove(l, lis[2]) + eq(lis[3], lib.tv_list_item_remove(l, lis[2])) alloc_log:check({a.freed(lis[2])}) eq({lis[1], lis[5], lis[7]}, {lws[1].lw_item, lws[2].lw_item, lws[3].lw_item}) - lib.tv_list_item_remove(l, lis[7]) + eq(nil, lib.tv_list_item_remove(l, lis[7])) alloc_log:check({a.freed(lis[7])}) eq({lis[1], lis[5], nil}, {lws[1].lw_item, lws[2].lw_item, lws[3].lw_item == nil and nil}) - lib.tv_list_item_remove(l, lis[1]) + eq(lis[3], lib.tv_list_item_remove(l, lis[1])) alloc_log:check({a.freed(lis[1])}) eq({lis[3], lis[5], nil}, {lws[1].lw_item, lws[2].lw_item, lws[3].lw_item == nil and nil}) |