aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_search.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-12 13:28:17 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-07-12 16:23:32 +0800
commit01afd43bc90408b43db906845245a4959c8ee3a0 (patch)
tree2386f072c52f5130d6ed83e33919dcd192f07b75 /src/nvim/testdir/test_search.vim
parent0f1b17788eb584f41d59c12c968f5e1886655334 (diff)
downloadrneovim-01afd43bc90408b43db906845245a4959c8ee3a0.tar.gz
rneovim-01afd43bc90408b43db906845245a4959c8ee3a0.tar.bz2
rneovim-01afd43bc90408b43db906845245a4959c8ee3a0.zip
vim-patch:8.2.0275: some Ex code not covered by tests
Problem: Some Ex code not covered by tests. Solution: Add test cases. (Yegappan Lakshmanan, closes vim/vim#5659) https://github.com/vim/vim/commit/406cd90f1963ca60813db91c413eef4b1b78ee44
Diffstat (limited to 'src/nvim/testdir/test_search.vim')
-rw-r--r--src/nvim/testdir/test_search.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim
index b4ed811626..9aa51d501b 100644
--- a/src/nvim/testdir/test_search.vim
+++ b/src/nvim/testdir/test_search.vim
@@ -1600,6 +1600,33 @@ func Test_search_tilde_pat()
call delete('Xresult')
endfunc
+" Test for searching a pattern that is not present with 'nowrapscan'
+func Test_search_pat_not_found()
+ new
+ set nowrapscan
+ let @/ = '1abcxyz2'
+ call assert_fails('normal n', 'E385:')
+ call assert_fails('normal N', 'E384:')
+ set wrapscan&
+ close
+endfunc
+
+" Test for v:searchforward variable
+func Test_searchforward_var()
+ new
+ call setline(1, ['foo', '', 'foo'])
+ call cursor(2, 1)
+ let @/ = 'foo'
+ let v:searchforward = 0
+ normal N
+ call assert_equal(3, line('.'))
+ call cursor(2, 1)
+ let v:searchforward = 1
+ normal N
+ call assert_equal(1, line('.'))
+ close!
+endfunc
+
" Test 'smartcase' with utf-8.
func Test_search_smartcase_utf8()
new