vim-patch:9.0.0053: E1281 not tested with the old regexp engine

Problem:    E1281 not tested with the old regexp engine.
Solution:   Loop over the values of 'regexp'. (Dominique Pellé, closes vim/vim#10695)

3a393790a4

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
This commit is contained in:
zeertzjq
2022-11-05 16:03:00 +08:00
parent b84666d2a0
commit e33ffab1a7

View File

@@ -1063,13 +1063,17 @@ func Test_using_two_engines_pattern()
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:')
for j in range(0, 2)
exe "set re=" .. i
call cursor(j + 1, 7)
call assert_fails("%s/foobar\\%#=" .. j, 'E1281:')
endfor
endfor
set re=0
" \%#= at the start of the pattern
for i in range(0, 2)
call cursor( (i+1), 7)
call cursor(i + 1, 7)
exe ":%s/\\%#=" .. i .. "foobar=" .. i .. "/xx"
endfor
call assert_equal(['xx', 'xx', 'xx'], getline(1, '$'))