summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_edit.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-06-30 22:13:59 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-30 22:13:59 +0100
commitfa4873ccfc10e0f278dc46f39d00136fab059b19 (patch)
tree55d4275e939188fc973d53bcf19e3d6136e6efe6 /src/testdir/test_edit.vim
parentcdbfc6dbab1d63aa56af316d6b13e37939e7f7a8 (diff)
patch 9.0.0013: reproducing memory access errors can be difficultv9.0.0013
Problem: Reproducing memory access errors can be difficult. Solution: When testing, copy each line to allocated memory, so that valgrind can detect accessing memory before and/or after it. Fix uncovered problems.
Diffstat (limited to 'src/testdir/test_edit.vim')
-rw-r--r--src/testdir/test_edit.vim3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim
index 4c5c957beb..6dc6272713 100644
--- a/src/testdir/test_edit.vim
+++ b/src/testdir/test_edit.vim
@@ -1860,6 +1860,9 @@ func Test_edit_insertmode_ex_edit()
call writefile(lines, 'Xtest_edit_insertmode_ex_edit')
let buf = RunVimInTerminal('-S Xtest_edit_insertmode_ex_edit', #{rows: 6})
+ " Somehow this can be very slow with valgrind. A separate TermWait() works
+ " better than a longer time with WaitForAssert() (why?)
+ call TermWait(buf, 1000)
call WaitForAssert({-> assert_match('^-- INSERT --\s*$', term_getline(buf, 6))})
call term_sendkeys(buf, "\<C-B>\<C-L>")
call WaitForAssert({-> assert_notmatch('^-- INSERT --\s*$', term_getline(buf, 6))})