diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-07-08 10:34:32 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-07-12 05:36:33 +0800 |
| commit | eea6a4f2a0ad089e0f92dfbc54c92d88c9fea51e (patch) | |
| tree | 811c70520a6b9874d7b86f316f290aae40cb6063 /src/nvim/testdir/test_substitute.vim | |
| parent | e71cc4a8dc2698038d4a92a8afe216aa891d67bc (diff) | |
| download | rneovim-eea6a4f2a0ad089e0f92dfbc54c92d88c9fea51e.tar.gz rneovim-eea6a4f2a0ad089e0f92dfbc54c92d88c9fea51e.tar.bz2 rneovim-eea6a4f2a0ad089e0f92dfbc54c92d88c9fea51e.zip | |
vim-patch:8.2.{0212,0250}
vim-patch:8.2.0212: missing search/substitute pattern hardly tested
Problem: Missing search/substitute pattern hardly tested.
Solution: Add test_clear_search_pat() and tests. (Yegappan Lakshmanan,
closes vim/vim#5579)
https://github.com/vim/vim/commit/07ada5ff2fd8f22ed3233ae5c4ddf87c7b3f56fe
vim-patch:8.2.0250: test_clear_search_pat() is unused
Problem: test_clear_search_pat() is unused.
Solution: Remove the function. (Yegappan Lakshmanan, closes vim/vim#5624)
https://github.com/vim/vim/commit/4f5776c17cd86f904a7e2f92db297c73e28939b7
Diffstat (limited to 'src/nvim/testdir/test_substitute.vim')
| -rw-r--r-- | src/nvim/testdir/test_substitute.vim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_substitute.vim b/src/nvim/testdir/test_substitute.vim index 619b63202a..d813b094e2 100644 --- a/src/nvim/testdir/test_substitute.vim +++ b/src/nvim/testdir/test_substitute.vim @@ -808,6 +808,21 @@ func Test_sub_expand_text() close! endfunc +" Test for command failures when the last substitute pattern is not set. +func Test_sub_with_no_last_pat() + call test_clear_search_pat() + call assert_fails('~', 'E33:') + call assert_fails('s//abc/g', 'E476:') + call assert_fails('s\/bar', 'E476:') + call assert_fails('s\&bar&', 'E476:') + + call test_clear_search_pat() + let save_cpo = &cpo + set cpo+=/ + call assert_fails('s/abc/%/', 'E33:') + let &cpo = save_cpo +endfunc + func Test_submatch_list_concatenate() let pat = 'A\(.\)' let Rep = {-> string([submatch(0, 1)] + [[submatch(1)]])} |