aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-04 21:49:48 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-05-05 19:43:13 +0800
commit17c8e39f8803daa6f0e6106ce1c087240cef4771 (patch)
treeb55ced02f17abbee930fc4c2e062a40be1639b94 /test
parent0a3a2132d43be3a376214f75157d4d2b1340311e (diff)
downloadrneovim-17c8e39f8803daa6f0e6106ce1c087240cef4771.tar.gz
rneovim-17c8e39f8803daa6f0e6106ce1c087240cef4771.tar.bz2
rneovim-17c8e39f8803daa6f0e6106ce1c087240cef4771.zip
vim-patch:9.0.0213: using freed memory with error in assert argument
Problem: Using freed memory with error in assert argument. Solution: Make a copy of the error. https://github.com/vim/vim/commit/249e1b903a9c0460d618f6dcc59aeb8c03b24b20 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_assert.vim4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/old/testdir/test_assert.vim b/test/old/testdir/test_assert.vim
index 5fd0103d27..27f0491634 100644
--- a/test/old/testdir/test_assert.vim
+++ b/test/old/testdir/test_assert.vim
@@ -277,6 +277,10 @@ func Test_assert_fail_fails()
let exp = v:exception
endtry
call assert_match("E1174: String required for argument 5", exp)
+
+ call assert_equal(1, assert_fails('c0', ['', '\1']))
+ call assert_match("Expected '\\\\\\\\1' but got 'E939: Positive count required: c0': c0", v:errors[0])
+ call remove(v:errors, 0)
endfunc
func Test_assert_fails_in_try_block()