Patch 8.2.0332
Problem: Some code in ex_getln.c not covered by tests.
Solution: Add a few more tests. (Yegappan Lakshmanan, closes #5710)
Files: src/testdir/test_arabic.vim, src/testdir/test_cmdline.vim
*** ../vim-8.2.0331/src/testdir/test_arabic.vim 2019-06-15 17:28:17.000000000 +0200
--- src/testdir/test_arabic.vim 2020-02-29 14:22:00.494048687 +0100
***************
*** 562,564 ****
--- 562,587 ----
set arabicshape&
bwipe!
endfunc
+
+ " Test for entering arabic character in a search command
+ func Test_arabic_chars_in_search_cmd()
+ new
+ set arabic
+ call feedkeys("i\nsghl!\<C-^>vim\<C-^>", 'tx')
+ call cursor(1, 1)
+ call feedkeys("/^sghl!\<C-^>vim$\<C-^>\<CR>", 'tx')
+ call assert_equal([2, 1], [line('.'), col('.')])
+
+ " Try searching in left-to-right mode
+ set rightleftcmd=
+ call cursor(1, 1)
+ call feedkeys("/^sghl!\<C-^>vim$\<CR>", 'tx')
+ call assert_equal([2, 1], [line('.'), col('.')])
+
+ set rightleftcmd&
+ set rightleft&
+ set arabic&
+ bwipe!
+ endfunc
+
+ " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0331/src/testdir/test_cmdline.vim 2020-02-27 21:32:38.681185130 +0100
--- src/testdir/test_cmdline.vim 2020-02-29 14:22:00.494048687 +0100
***************
*** 473,481 ****
endtry
call assert_equal("Xtestfile", bufname("%"))
- " Use an invalid expression for <C-\>e
- call assert_beeps('call feedkeys(":\<C-\>einvalid\<CR>", "tx")')
-
" Try to paste an invalid register using <C-R>
call feedkeys(":\"one\<C-R>\<C-X>two\<CR>", 'xt')
call assert_equal('"onetwo', @:)
--- 473,478 ----
***************
*** 1176,1184 ****
set wildmode&
endfunc
func Test_cmdline_edit()
! call feedkeys(":\"buffer\<Right>\<Home>\<Left>\<CR>", 'xt')
! call assert_equal("\"buffer", @:)
endfunc
" vim: shiftwidth=2 sts=2 expandtab
--- 1173,1225 ----
set wildmode&
endfunc
+ " Test for moving the cursor on the : command line
func Test_cmdline_edit()
! let str = ":one two\<C-U>"
! let str ..= "one two\<C-W>\<C-W>"
! let str ..= "\<Left>five\<Right>"
! let str ..= "\<Home>two "
! let str ..= "\<C-Left>one "
! let str ..= "\<C-Right> three"
! let str ..= "\<End>\<S-Left>four "
! let str ..= "\<S-Right> six"
! let str ..= "\<C-B>\"\<C-E> seven\<CR>"
! call feedkeys(str, 'xt')
! call assert_equal("\"one two three four five six seven", @:)
! endfunc
!
! " Test for moving the cursor on the / command line in 'rightleft' mode
! func Test_cmdline_edit_rightleft()
! CheckFeature rightleft
! set rightleft
! set rightleftcmd=search
! let str = "/one two\<C-U>"
! let str ..= "one two\<C-W>\<C-W>"
! let str ..= "\<Right>five\<Left>"
! let str ..= "\<Home>two "
! let str ..= "\<C-Right>one "
! let str ..= "\<C-Left> three"
! let str ..= "\<End>\<S-Right>four "
! let str ..= "\<S-Left> six"
! let str ..= "\<C-B>\"\<C-E> seven\<CR>"
! call assert_fails("call feedkeys(str, 'xt')", 'E486:')
! call assert_equal("\"one two three four five six seven", @/)
! set rightleftcmd&
! set rightleft&
! endfunc
!
! " Test for using <C-\>e in the command line to evaluate an expression
! func Test_cmdline_expr()
! " Evaluate an expression from the beginning of a command line
! call feedkeys(":abc\<C-B>\<C-\>e\"\\\"hello\"\<CR>\<CR>", 'xt')
! call assert_equal('"hello', @:)
!
! " Use an invalid expression for <C-\>e
! call assert_beeps('call feedkeys(":\<C-\>einvalid\<CR>", "tx")')
!
! " Insert literal <CTRL-\> in the command line
! call feedkeys(":\"e \<C-\>\<C-Y>\<CR>", 'xt')
! call assert_equal("\"e \<C-\>\<C-Y>", @:)
endfunc
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0331/src/version.c 2020-02-29 13:43:23.698780174 +0100
--- src/version.c 2020-02-29 14:23:34.621767115 +0100
***************
*** 740,741 ****
--- 740,743 ----
{ /* Add new patch number below this line */
+ /**/
+ 332,
/**/
--
There are three kinds of persons: Those who can count and those who can't.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language --
http://www.Zimbu.org ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///