Mercurial > vim
comparison src/testdir/test_search.vim @ 19973:9f5758ee0b10 v8.2.0542
patch 8.2.0542: no test for E386
Commit: https://github.com/vim/vim/commit/8832a3457831707286dd2d9252ba14a5f9fd4c60
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 11 18:36:38 2020 +0200
patch 8.2.0542: no test for E386
Problem: No test for E386.
Solution: Add a test. (Dominique Pelle, closes https://github.com/vim/vim/issues/5911)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 11 Apr 2020 18:45:03 +0200 |
parents | b07672d13ff9 |
children | 0b35a7ffceb2 |
comparison
equal
deleted
inserted
replaced
19972:1cd7f3ea9339 | 19973:9f5758ee0b10 |
---|---|
15 " Test 1 | 15 " Test 1 |
16 " CTRL-N / CTRL-P skips through the previous search history | 16 " CTRL-N / CTRL-P skips through the previous search history |
17 set noincsearch | 17 set noincsearch |
18 :1 | 18 :1 |
19 call feedkeys("/foobar\<cr>", 'tx') | 19 call feedkeys("/foobar\<cr>", 'tx') |
20 call feedkeys("/the\<cr>",'tx') | 20 call feedkeys("/the\<cr>", 'tx') |
21 call assert_equal('the', @/) | 21 call assert_equal('the', @/) |
22 call feedkeys("/thes\<C-P>\<C-P>\<cr>",'tx') | 22 call feedkeys("/thes\<C-P>\<C-P>\<cr>", 'tx') |
23 call assert_equal('foobar', @/) | 23 call assert_equal('foobar', @/) |
24 | 24 |
25 " Test 2 | 25 " Test 2 |
26 " Ctrl-G goes from one match to the next | 26 " Ctrl-G goes from one match to the next |
27 " until the end of the buffer | 27 " until the end of the buffer |
1349 endtry | 1349 endtry |
1350 set re& | 1350 set re& |
1351 endfunc | 1351 endfunc |
1352 | 1352 |
1353 func Test_one_error_msg() | 1353 func Test_one_error_msg() |
1354 " This was also giving an internal error | 1354 " This was also giving an internal error |
1355 call assert_fails('call search(" \\((\\v[[=P=]]){185}+ ")', 'E871:') | 1355 call assert_fails('call search(" \\((\\v[[=P=]]){185}+ ")', 'E871:') |
1356 endfunc | 1356 endfunc |
1357 | 1357 |
1358 func Test_incsearch_add_char_under_cursor() | 1358 func Test_incsearch_add_char_under_cursor() |
1359 CheckOption incsearch | 1359 CheckOption incsearch |
1400 call assert_fails("call search('pat', [])", 'E730:') | 1400 call assert_fails("call search('pat', [])", 'E730:') |
1401 call assert_fails("call search('pat', 'b', {})", 'E728:') | 1401 call assert_fails("call search('pat', 'b', {})", 'E728:') |
1402 call assert_fails("call search('pat', 'b', 1, [])", 'E745:') | 1402 call assert_fails("call search('pat', 'b', 1, [])", 'E745:') |
1403 call assert_fails("call search('pat', 'ns')", 'E475:') | 1403 call assert_fails("call search('pat', 'ns')", 'E475:') |
1404 call assert_fails("call search('pat', 'mr')", 'E475:') | 1404 call assert_fails("call search('pat', 'mr')", 'E475:') |
1405 | |
1406 new | |
1407 call setline(1, ['foo', 'bar']) | |
1408 call assert_fails('call feedkeys("/foo/;/bar/;\<CR>", "tx")', 'E386:') | |
1409 bwipe! | |
1405 endfunc | 1410 endfunc |
1406 | 1411 |
1407 func Test_search_display_pattern() | 1412 func Test_search_display_pattern() |
1408 new | 1413 new |
1409 call setline(1, ['foo', 'bar', 'foobar']) | 1414 call setline(1, ['foo', 'bar', 'foobar']) |