summaryrefslogtreecommitdiff
path: root/src/testdir/test_expr.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-10-02 16:51:57 +0200
committerBram Moolenaar <Bram@vim.org>2016-10-02 16:51:57 +0200
commit6100d02aab7c8294b581cb299250eea164b50e9d (patch)
tree753bb02aa6aa2b9121a640b343f5c0a220bfd40e /src/testdir/test_expr.vim
parent2ec618c9feac4573b154510236ad8121c77d0eca (diff)
downloadvim-git-6100d02aab7c8294b581cb299250eea164b50e9d.tar.gz
patch 8.0.0020v8.0.0020
Problem: The regexp engines are not reentrant. Solution: Add regexec_T and save/restore the state when needed.
Diffstat (limited to 'src/testdir/test_expr.vim')
-rw-r--r--src/testdir/test_expr.vim5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim
index dff8e36f4..e5c918c8c 100644
--- a/src/testdir/test_expr.vim
+++ b/src/testdir/test_expr.vim
@@ -405,9 +405,10 @@ func Test_substitute_expr()
\ {-> submatch(2) . submatch(3) . submatch(1)}, ''))
func Recurse()
- return substitute('yyy', 'y*', {-> g:val}, '')
+ return substitute('yyy', 'y\(.\)y', {-> submatch(1)}, '')
endfunc
- call assert_equal('--', substitute('xxx', 'x*', {-> '-' . Recurse() . '-'}, ''))
+ " recursive call works
+ call assert_equal('-y-x-', substitute('xxx', 'x\(.\)x', {-> '-' . Recurse() . '-' . submatch(1) . '-'}, ''))
endfunc
func Test_invalid_submatch()