From 2b98bdd75b7ffc8c876d1e03c96a4edc4c1e1b12 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Wed, 25 Nov 2020 16:21:00 +0000 Subject: vim-patch:8.1.0756: copy() does not make a copy of a Blob Problem: copy() does not make a copy of a Blob. Solution: Make a copy. https://github.com/vim/vim/commit/3d28b58c519c9fc3427587201423c74746cc219e Replace vim_memsave() with xmemdup(). --- src/nvim/testdir/test_blob.vim | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_blob.vim b/src/nvim/testdir/test_blob.vim index 5bee25a0a2..b2b5ddcfd6 100644 --- a/src/nvim/testdir/test_blob.vim +++ b/src/nvim/testdir/test_blob.vim @@ -112,7 +112,14 @@ func Test_blob_compare() call assert_false(b1 is b2) let b2 = b1 + call assert_true(b1 == b2) call assert_true(b1 is b2) + let b2 = copy(b1) + call assert_true(b1 == b2) + call assert_false(b1 is b2) + let b2 = b1[:] + call assert_true(b1 == b2) + call assert_false(b1 is b2) call assert_fails('let x = b1 > b2') call assert_fails('let x = b1 < b2') -- cgit