comparison src/testdir/test_search.vim @ 19435:8f8a5a15d00a v8.2.0275

patch 8.2.0275: some Ex code not covered by tests Commit: https://github.com/vim/vim/commit/406cd90f1963ca60813db91c413eef4b1b78ee44 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 18 21:54:41 2020 +0100 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 https://github.com/vim/vim/issues/5659)
author Bram Moolenaar <Bram@vim.org>
date Tue, 18 Feb 2020 22:00:04 +0100
parents 02111977dd05
children 5512aa74cb62
comparison
equal deleted inserted replaced
19434:4f7cdab4da93 19435:8f8a5a15d00a
1513 endif 1513 endif
1514 call delete('Xscript') 1514 call delete('Xscript')
1515 call delete('Xresult') 1515 call delete('Xresult')
1516 endfunc 1516 endfunc
1517 1517
1518 " Test for searching a pattern that is not present with 'nowrapscan'
1519 func Test_search_pat_not_found()
1520 new
1521 set nowrapscan
1522 let @/ = '1abcxyz2'
1523 call assert_fails('normal n', 'E385:')
1524 call assert_fails('normal N', 'E384:')
1525 set wrapscan&
1526 close
1527 endfunc
1528
1529 " Test for v:searchforward variable
1530 func Test_searchforward_var()
1531 new
1532 call setline(1, ['foo', '', 'foo'])
1533 call cursor(2, 1)
1534 let @/ = 'foo'
1535 let v:searchforward = 0
1536 normal N
1537 call assert_equal(3, line('.'))
1538 call cursor(2, 1)
1539 let v:searchforward = 1
1540 normal N
1541 call assert_equal(1, line('.'))
1542 close!
1543 endfunc
1544
1518 " vim: shiftwidth=2 sts=2 expandtab 1545 " vim: shiftwidth=2 sts=2 expandtab