Mercurial > vim
diff src/testdir/test_regexp_latin.vim @ 11525:14b6b79d685b v8.0.0645
patch 8.0.0645: no error for illegal back reference in NFA engine
commit https://github.com/vim/vim/commit/1ef9bbe215e13a273e74fccaddd8fc5a42c76b6e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 17 20:08:20 2017 +0200
patch 8.0.0645: no error for illegal back reference in NFA engine
Problem: The new regexp engine does not give an error for using a back
reference where it is not allowed. (Dominique Pelle)
Solution: Check the back reference like the old engine. (closes #1774)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 17 Jun 2017 20:15:03 +0200 |
parents | 4acacf4081ce |
children | b143545e3354 |
line wrap: on
line diff
--- a/src/testdir/test_regexp_latin.vim +++ b/src/testdir/test_regexp_latin.vim @@ -62,3 +62,13 @@ func Test_eow_with_optional() call assert_equal(expected, actual) endfor endfunc + +func Test_backref() + new + call setline(1, ['one', 'two', 'three', 'four', 'five']) + call assert_equal(3, search('\%#=1\(e\)\1')) + call assert_equal(3, search('\%#=2\(e\)\1')) + call assert_fails('call search("\\%#=1\\(e\\1\\)")', 'E65:') + call assert_fails('call search("\\%#=2\\(e\\1\\)")', 'E65:') + bwipe! +endfunc