mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
vim-patch:8.2.0539: comparing two NULL list fails
Problem: Comparing two NULL list fails. Solution: Change the order of comparing two lists.7b293c730b
N/A patches for version.c: vim-patch:8.2.1187: terminal2 test sometimes hangs in the GUI on Travis Problem: Terminal2 test sometimes hangs in the GUI on Travis. Solution: Disable Test_zz2_terminal_guioptions_bang() for now.c85156bb89
vim-patch:8.2.1188: memory leak with invalid json input Problem: Memory leak with invalid json input. Solution: Free all keys at the end. (Dominique Pellé, closes vim/vim#6443, closes vim/vim#6442)6d3a7213f5
vim-patch:8.2.1196: build failure with normal features Problem: Build failure with normal features. Solution: Add #ifdef.83e7450053
vim-patch:8.2.1198: terminal2 test sometimes hangs in the GUI on Travis Problem: Terminal2 test sometimes hangs in the GUI on Travis. Solution: Move test function to terminal3 to see if the problem moves too.a4b442614c
This commit is contained in:
@@ -799,10 +799,14 @@ bool tv_list_equal(list_T *const l1, list_T *const l2, const bool ic,
|
|||||||
if (l1 == l2) {
|
if (l1 == l2) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (l1 == NULL || l2 == NULL) {
|
if (tv_list_len(l1) != tv_list_len(l2)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (tv_list_len(l1) != tv_list_len(l2)) {
|
if (tv_list_len(l1) == 0) {
|
||||||
|
// empty and NULL list are considered equal
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (l1 == NULL || l2 == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -47,10 +47,8 @@ describe('NULL', function()
|
|||||||
|
|
||||||
-- Subjectable behaviour
|
-- Subjectable behaviour
|
||||||
|
|
||||||
-- FIXME Should return 1
|
null_expr_test('is equal to empty list', 'L == []', 0, 1)
|
||||||
null_expr_test('is equal to empty list', 'L == []', 0, 0)
|
null_expr_test('is equal to empty list (reverse order)', '[] == L', 0, 1)
|
||||||
-- FIXME Should return 1
|
|
||||||
null_expr_test('is equal to empty list (reverse order)', '[] == L', 0, 0)
|
|
||||||
|
|
||||||
-- Correct behaviour
|
-- Correct behaviour
|
||||||
null_expr_test('can be indexed with error message for empty list', 'L[0]',
|
null_expr_test('can be indexed with error message for empty list', 'L[0]',
|
||||||
|
@@ -38,6 +38,9 @@ describe('assert function:', function()
|
|||||||
call assert_equal(4, n)
|
call assert_equal(4, n)
|
||||||
let l = [1, 2, 3]
|
let l = [1, 2, 3]
|
||||||
call assert_equal([1, 2, 3], l)
|
call assert_equal([1, 2, 3], l)
|
||||||
|
call assert_equal(v:_null_list, v:_null_list)
|
||||||
|
call assert_equal(v:_null_list, [])
|
||||||
|
call assert_equal([], v:_null_list)
|
||||||
fu Func()
|
fu Func()
|
||||||
endfu
|
endfu
|
||||||
let F1 = function('Func')
|
let F1 = function('Func')
|
||||||
|
@@ -1234,13 +1234,13 @@ describe('typval.c', function()
|
|||||||
local l = list()
|
local l = list()
|
||||||
local l2 = list()
|
local l2 = list()
|
||||||
|
|
||||||
-- NULL lists are not equal to empty lists
|
-- NULL lists are equal to empty lists
|
||||||
eq(false, lib.tv_list_equal(l, nil, true, false))
|
eq(true, lib.tv_list_equal(l, nil, true, false))
|
||||||
eq(false, lib.tv_list_equal(nil, l, false, false))
|
eq(true, lib.tv_list_equal(nil, l, false, false))
|
||||||
eq(false, lib.tv_list_equal(nil, l, false, true))
|
eq(true, lib.tv_list_equal(nil, l, false, true))
|
||||||
eq(false, lib.tv_list_equal(l, nil, true, true))
|
eq(true, lib.tv_list_equal(l, nil, true, true))
|
||||||
|
|
||||||
-- Yet NULL lists are equal themselves
|
-- NULL lists are equal themselves
|
||||||
eq(true, lib.tv_list_equal(nil, nil, true, false))
|
eq(true, lib.tv_list_equal(nil, nil, true, false))
|
||||||
eq(true, lib.tv_list_equal(nil, nil, false, false))
|
eq(true, lib.tv_list_equal(nil, nil, false, false))
|
||||||
eq(true, lib.tv_list_equal(nil, nil, false, true))
|
eq(true, lib.tv_list_equal(nil, nil, false, true))
|
||||||
@@ -2648,13 +2648,13 @@ describe('typval.c', function()
|
|||||||
local l2 = lua2typvalt(empty_list)
|
local l2 = lua2typvalt(empty_list)
|
||||||
local nl = lua2typvalt(null_list)
|
local nl = lua2typvalt(null_list)
|
||||||
|
|
||||||
-- NULL lists are not equal to empty lists
|
-- NULL lists are equal to empty lists
|
||||||
eq(false, lib.tv_equal(l, nl, true, false))
|
eq(true, lib.tv_equal(l, nl, true, false))
|
||||||
eq(false, lib.tv_equal(nl, l, false, false))
|
eq(true, lib.tv_equal(nl, l, false, false))
|
||||||
eq(false, lib.tv_equal(nl, l, false, true))
|
eq(true, lib.tv_equal(nl, l, false, true))
|
||||||
eq(false, lib.tv_equal(l, nl, true, true))
|
eq(true, lib.tv_equal(l, nl, true, true))
|
||||||
|
|
||||||
-- Yet NULL lists are equal themselves
|
-- NULL lists are equal themselves
|
||||||
eq(true, lib.tv_equal(nl, nl, true, false))
|
eq(true, lib.tv_equal(nl, nl, true, false))
|
||||||
eq(true, lib.tv_equal(nl, nl, false, false))
|
eq(true, lib.tv_equal(nl, nl, false, false))
|
||||||
eq(true, lib.tv_equal(nl, nl, false, true))
|
eq(true, lib.tv_equal(nl, nl, false, true))
|
||||||
|
Reference in New Issue
Block a user