Patch 8.2.0342
Problem:    Some code in ex_getln.c not covered by tests.
Solution:   Add more tests. (Yegappan Lakshmanan, closes #5717)
Files:      src/testdir/test_cmdline.vim, src/testdir/test_ex_mode.vim,
            src/testdir/test_history.vim, src/testdir/test_iminsert.vim


*** ../vim-8.2.0341/src/testdir/test_cmdline.vim        2020-02-29 
22:06:25.647709244 +0100
--- src/testdir/test_cmdline.vim        2020-03-01 16:49:39.419245507 +0100
***************
*** 1188,1193 ****
--- 1188,1194 ----
  func Test_cmdline_edit()
    let str = ":one two\<C-U>"
    let str ..= "one two\<C-W>\<C-W>"
+   let str ..= "one\<BS>\<C-H>\<Del>"
    let str ..= "\<Left>five\<Right>"
    let str ..= "\<Home>two "
    let str ..= "\<C-Left>one "
***************
*** 1206,1211 ****
--- 1207,1213 ----
    set rightleftcmd=search
    let str = "/one two\<C-U>"
    let str ..= "one two\<C-W>\<C-W>"
+   let str ..= "one\<BS>\<C-H>\<Del>"
    let str ..= "\<Right>five\<Left>"
    let str ..= "\<Home>two "
    let str ..= "\<C-Right>one "
***************
*** 1233,1236 ****
--- 1235,1271 ----
    call assert_equal("\"e \<C-\>\<C-Y>", @:)
  endfunc
  
+ " Test for 'imcmdline' and 'imsearch'
+ " This test doesn't actually test the input method functionality.
+ func Test_cmdline_inputmethod()
+   new
+   call setline(1, ['', 'abc', ''])
+   set imcmdline
+ 
+   call feedkeys(":\"abc\<CR>", 'xt')
+   call assert_equal("\"abc", @:)
+   call feedkeys(":\"\<C-^>abc\<C-^>\<CR>", 'xt')
+   call assert_equal("\"abc", @:)
+   call feedkeys("/abc\<CR>", 'xt')
+   call assert_equal([2, 1], [line('.'), col('.')])
+   call feedkeys("/\<C-^>abc\<C-^>\<CR>", 'xt')
+   call assert_equal([2, 1], [line('.'), col('.')])
+ 
+   set imsearch=2
+   call cursor(1, 1)
+   call feedkeys("/abc\<CR>", 'xt')
+   call assert_equal([2, 1], [line('.'), col('.')])
+   call cursor(1, 1)
+   call feedkeys("/\<C-^>abc\<C-^>\<CR>", 'xt')
+   call assert_equal([2, 1], [line('.'), col('.')])
+   set imdisable
+   call feedkeys("/\<C-^>abc\<C-^>\<CR>", 'xt')
+   call assert_equal([2, 1], [line('.'), col('.')])
+   set imdisable&
+   set imsearch&
+ 
+   set imcmdline&
+   %bwipe!
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0341/src/testdir/test_ex_mode.vim        2020-02-27 
21:32:38.681185130 +0100
--- src/testdir/test_ex_mode.vim        2020-03-01 16:49:39.419245507 +0100
***************
*** 49,54 ****
--- 49,56 ----
      call assert_equal(['  foo', '    foo'],       Ex("    foo\<C-d>"), e)
      call assert_equal(['foo', '    foo0'],        Ex("    foo0\<C-d>"), e)
      call assert_equal(['foo', '    foo^'],        Ex("    foo^\<C-d>"), e)
+     call assert_equal(['foo', 'foo'],
+           \ Ex("\<BS>\<C-H>\<Del>foo"), e)
    endfor
  
    set sw&
***************
*** 128,131 ****
--- 130,142 ----
    call assert_equal("a\rb", l)
  endfunc
  
+ " Test for :append! command in Ex mode
+ func Test_Ex_append()
+   new
+   call setline(1, "\t   abc")
+   call feedkeys("Qappend!\npqr\nxyz\n.\nvisual\n", 'xt')
+   call assert_equal(["\t   abc", "\t   pqr", "\t   xyz"], getline(1, '$'))
+   close!
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0341/src/testdir/test_history.vim        2020-02-27 
21:32:38.681185130 +0100
--- src/testdir/test_history.vim        2020-03-01 16:49:39.419245507 +0100
***************
*** 114,119 ****
--- 114,120 ----
    bwipe!
  endfunc
  
+ " Test for :history command option completion
  function Test_history_completion()
    call feedkeys(":history \<C-A>\<C-B>\"\<CR>", 'tx')
    call assert_equal('"history / : = > ? @ all cmd debug expr input search', 
@:)
***************
*** 122,129 ****
  " Test for increasing the 'history' option value
  func Test_history_size()
    let save_histsz = &history
-   call histdel(':')
    set history=10
    for i in range(1, 5)
      call histadd(':', 'cmd' .. i)
    endfor
--- 123,131 ----
  " Test for increasing the 'history' option value
  func Test_history_size()
    let save_histsz = &history
    set history=10
+   call histadd(':', 'ls')
+   call histdel(':')
    for i in range(1, 5)
      call histadd(':', 'cmd' .. i)
    endfor
***************
*** 173,178 ****
--- 175,187 ----
    call assert_equal(['pat2', 'pat1', ''], g:pat)
    cunmap <F2>
    delfunc SavePat
+ 
+   " Recall patterns with 'history' set to 0
+   set history=0
+   let @/ = 'abc'
+   let cmd = 'call feedkeys("/\<Up>\<Down>\<S-Up>\<S-Down>\<CR>", "xt")'
+   call assert_fails(cmd, 'E486:')
+   set history&
  endfunc
  
  " Test for making sure the key value is not stored in history
*** ../vim-8.2.0341/src/testdir/test_iminsert.vim       2019-12-07 
21:40:17.000000000 +0100
--- src/testdir/test_iminsert.vim       2020-03-01 16:49:39.419245507 +0100
***************
*** 62,64 ****
--- 62,66 ----
    set imactivatefunc=
    set imstatusfunc=
  endfunc
+ 
+ " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0341/src/version.c       2020-03-01 16:22:37.064963530 +0100
--- src/version.c       2020-03-01 16:50:35.975046885 +0100
***************
*** 740,741 ****
--- 740,743 ----
  {   /* Add new patch number below this line */
+ /**/
+     342,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
149. You find your computer sexier than your girlfriend

 /// Bram Moolenaar -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202003011553.021FrcZu031679%40masaka.moolenaar.net.

Raspunde prin e-mail lui