mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.0542: no test for E386
Problem: No test for E386.
Solution: Add a test. (Dominique Pelle, closes vim/vim#5911)
8832a34578
Cherry-pick Test_search_errors() from patch 8.2.0448.
This commit is contained in:
parent
ba5ff6e5f0
commit
8bfcff6c4a
@ -19,9 +19,9 @@ func Test_search_cmdline()
|
|||||||
set noincsearch
|
set noincsearch
|
||||||
:1
|
:1
|
||||||
call feedkeys("/foobar\<cr>", 'tx')
|
call feedkeys("/foobar\<cr>", 'tx')
|
||||||
call feedkeys("/the\<cr>",'tx')
|
call feedkeys("/the\<cr>", 'tx')
|
||||||
call assert_equal('the', @/)
|
call assert_equal('the', @/)
|
||||||
call feedkeys("/thes\<C-P>\<C-P>\<cr>",'tx')
|
call feedkeys("/thes\<C-P>\<C-P>\<cr>", 'tx')
|
||||||
call assert_equal('foobar', @/)
|
call assert_equal('foobar', @/)
|
||||||
|
|
||||||
" Test 2
|
" Test 2
|
||||||
@ -1484,7 +1484,7 @@ func Test_large_hex_chars2()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_one_error_msg()
|
func Test_one_error_msg()
|
||||||
" This was also giving an internal error
|
" This was also giving an internal error
|
||||||
call assert_fails('call search(" \\((\\v[[=P=]]){185}+ ")', 'E871:')
|
call assert_fails('call search(" \\((\\v[[=P=]]){185}+ ")', 'E871:')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@ -1529,6 +1529,20 @@ func Test_search_match_at_curpos()
|
|||||||
close!
|
close!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Test for error cases with the search() function
|
||||||
|
func Test_search_errors()
|
||||||
|
call assert_fails("call search('pat', [])", 'E730:')
|
||||||
|
call assert_fails("call search('pat', 'b', {})", 'E728:')
|
||||||
|
call assert_fails("call search('pat', 'b', 1, [])", 'E745:')
|
||||||
|
call assert_fails("call search('pat', 'ns')", 'E475:')
|
||||||
|
call assert_fails("call search('pat', 'mr')", 'E475:')
|
||||||
|
|
||||||
|
new
|
||||||
|
call setline(1, ['foo', 'bar'])
|
||||||
|
call assert_fails('call feedkeys("/foo/;/bar/;\<CR>", "tx")', 'E386:')
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_search_display_pattern()
|
func Test_search_display_pattern()
|
||||||
new
|
new
|
||||||
call setline(1, ['foo', 'bar', 'foobar'])
|
call setline(1, ['foo', 'bar', 'foobar'])
|
||||||
|
Loading…
Reference in New Issue
Block a user