aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_search.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_search.vim')
-rw-r--r--src/nvim/testdir/test_search.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim
index c455279a59..5e5ec96fd1 100644
--- a/src/nvim/testdir/test_search.vim
+++ b/src/nvim/testdir/test_search.vim
@@ -325,6 +325,16 @@ func Test_searchpair_skip()
bw!
endfunc
+func Test_searchpair_leak()
+ new
+ call setline(1, 'if one else another endif')
+
+ " The error in the skip expression caused memory to leak.
+ call assert_fails("call searchpair('\\<if\\>', '\\<else\\>', '\\<endif\\>', '', '\"foo\" 2')", 'E15:')
+
+ bwipe!
+endfunc
+
func Test_searchc()
" These commands used to cause memory overflow in searchc().
new