Mercurial > vim
diff src/testdir/test_regexp_latin.vim @ 28911:e25196adb7c1 v8.2.4978
patch 8.2.4978: no error if engine selection atom is not at the start
Commit: https://github.com/vim/vim/commit/360da40b47a84ee8586c3b5d062f8c64a2ac9cc6
Author: Christian Brabandt <cb@256bit.org>
Date: Wed May 18 15:04:02 2022 +0100
patch 8.2.4978: no error if engine selection atom is not at the start
Problem: No error if engine selection atom is not at the start.
Solution: Give an error. (Christian Brabandt, closes https://github.com/vim/vim/issues/10439)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 18 May 2022 16:15:03 +0200 |
parents | 786707ef91de |
children | be069ab9d583 |
line wrap: on
line diff
--- a/src/testdir/test_regexp_latin.vim +++ b/src/testdir/test_regexp_latin.vim @@ -1096,4 +1096,22 @@ func Test_using_invalid_visual_position( bwipe! endfunc +func Test_using_two_engines_pattern() + new + call setline(1, ['foobar=0', 'foobar=1', 'foobar=2']) + " \%#= at the end of the pattern + for i in range(0, 2) + call cursor( (i+1), 7) + call assert_fails("%s/foobar\\%#=" .. i, 'E1281:') + endfor + + " \%#= at the start of the pattern + for i in range(0, 2) + call cursor( (i+1), 7) + exe ":%s/\\%#=" .. i .. "foobar=" .. i .. "/xx" + endfor + call assert_equal(['xx', 'xx', 'xx'], getline(1, '$')) + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab