aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-07-05 15:20:02 +0800
committerGitHub <noreply@github.com>2024-07-05 15:20:02 +0800
commit2a883d9c597e70d25ffc53373731d05d18a89b91 (patch)
tree8a6ab16a1d9ff24d4660fe11f602aee43a265d29 /test/old/testdir
parent3e6cec0befd41d37ee36cb4f602e84c58c5f0d27 (diff)
downloadrneovim-2a883d9c597e70d25ffc53373731d05d18a89b91.tar.gz
rneovim-2a883d9c597e70d25ffc53373731d05d18a89b91.tar.bz2
rneovim-2a883d9c597e70d25ffc53373731d05d18a89b91.zip
vim-patch:9.1.0524: the recursive parameter in the *_equal functions can be removed (#29572)
Problem: the recursive parameter in the *_equal functions can be removed Solution: Remove the recursive parameter in dict_equal(), list_equal() object_equal and tv_equal(). Use a comparison of the static var recursive_cnt == 0 to determine whether or not tv_equal() has been called recursively (Yinzuo Jiang). closes: vim/vim#15070 https://github.com/vim/vim/commit/7ccd1a2e858dbb2ac7fb09971dfcbfad62baa677 Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Diffstat (limited to 'test/old/testdir')
-rw-r--r--test/old/testdir/test_listdict.vim13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/old/testdir/test_listdict.vim b/test/old/testdir/test_listdict.vim
index 6c22dc0784..35d63c87d0 100644
--- a/test/old/testdir/test_listdict.vim
+++ b/test/old/testdir/test_listdict.vim
@@ -1055,6 +1055,19 @@ func Test_listdict_compare()
call assert_fails('echo {} =~ {}', 'E736:')
endfunc
+func Test_recursive_listdict_compare()
+ let l1 = [0, 1]
+ let l1[0] = l1
+ let l2 = [0, 1]
+ let l2[0] = l2
+ call assert_true(l1 == l2)
+ let d1 = {0: 0, 1: 1}
+ let d1[0] = d1
+ let d2 = {0: 0, 1: 1}
+ let d2[0] = d2
+ call assert_true(d1 == d2)
+endfunc
+
" compare complex recursively linked list and dict
func Test_listdict_compare_complex()
let lines =<< trim END