Patch 8.2.2643
Problem:    Various code not covered by tests.
Solution:   Add a few more test. (Yegappan Lakshmanan, closes #7995)
Files:      src/testdir/test_edit.vim, src/testdir/test_functions.vim,
            src/testdir/test_mapping.vim, src/testdir/test_termcodes.vim,
            src/testdir/test_undo.vim


*** ../vim-8.2.2642/src/testdir/test_edit.vim   2021-03-19 14:38:07.869248401 
+0100
--- src/testdir/test_edit.vim   2021-03-22 19:34:36.525309109 +0100
***************
*** 411,416 ****
--- 411,443 ----
    bwipe!
  endfunc
  
+ " Test for autoindent removing indent when insert mode is stopped.  Some parts
+ " of the code is exercised only when interactive mode is used. So use Vim in a
+ " terminal.
+ func Test_autoindent_remove_indent()
+   CheckRunVimInTerminal
+   let buf = RunVimInTerminal('-N Xfile', {'rows': 6, 'cols' : 20})
+   call TermWait(buf)
+   call term_sendkeys(buf, ":set autoindent\n")
+   " leaving insert mode in a new line with indent added by autoindent, should
+   " remove the indent.
+   call term_sendkeys(buf, "i\<Tab>foo\<CR>\<Esc>")
+   " Need to delay for sometime, otherwise the code in getchar.c will not be
+   " exercised.
+   call TermWait(buf, 50)
+   " when a line is wrapped and the cursor is at the start of the second line,
+   " leaving insert mode, should move the cursor back to the first line.
+   call term_sendkeys(buf, "o" .. repeat('x', 20) .. "\<Esc>")
+   " Need to delay for sometime, otherwise the code in getchar.c will not be
+   " exercised.
+   call TermWait(buf, 50)
+   call term_sendkeys(buf, ":w\n")
+   call TermWait(buf)
+   call StopVimInTerminal(buf)
+   call assert_equal(["\tfoo", '', repeat('x', 20)], readfile('Xfile'))
+   call delete('Xfile')
+ endfunc
+ 
  func Test_edit_CR()
    " Test for <CR> in insert mode
    " basically only in quickfix mode ist tested, the rest
*** ../vim-8.2.2642/src/testdir/test_functions.vim      2021-03-15 
18:36:16.725494781 +0100
--- src/testdir/test_functions.vim      2021-03-22 19:34:36.525309109 +0100
***************
*** 1431,1437 ****
    call assert_equal('item1 item2 item3', c)
  
    " Test for using special characters as default input
!   call feedkeys(":let c = input('name? ', \"x\<BS>y\")\<CR>\<CR>", 'xt')
    call assert_equal('y', c)
  
    " Test for using <CR> as default input
--- 1431,1437 ----
    call assert_equal('item1 item2 item3', c)
  
    " Test for using special characters as default input
!   call feedkeys(":let c = input('name? ', \"x\\<BS>y\")\<CR>\<CR>", 'xt')
    call assert_equal('y', c)
  
    " Test for using <CR> as default input
*** ../vim-8.2.2642/src/testdir/test_mapping.vim        2021-03-17 
13:39:30.657050576 +0100
--- src/testdir/test_mapping.vim        2021-03-22 19:34:36.525309109 +0100
***************
*** 1389,1392 ****
--- 1389,1402 ----
    ounmap i-
  endfunc
  
+ " Test for using <script> with a map to remap characters in rhs
+ func Test_script_local_remap()
+   new
+   inoremap <buffer> <SID>xyz mno
+   inoremap <buffer> <script> abc st<SID>xyzre
+   normal iabc
+   call assert_equal('stmnore', getline(1))
+   bwipe!
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.2642/src/testdir/test_termcodes.vim      2021-01-30 
15:39:44.312670945 +0100
--- src/testdir/test_termcodes.vim      2021-03-22 19:34:36.525309109 +0100
***************
*** 2314,2317 ****
--- 2314,2351 ----
    endfor
  endfunc
  
+ " Test for terminal keycodes that doesn't have termcap entries
+ func Test_special_term_keycodes()
+   new
+   " Test for <xHome>, <S-xHome> and <C-xHome>
+   " send <K_SPECIAL> <KS_EXTRA> keycode
+   call feedkeys("i\<C-K>\x80\xfd\x3f\n", 'xt')
+   " send <K_SPECIAL> <KS_MODIFIER> bitmap <K_SPECIAL> <KS_EXTRA> keycode
+   call feedkeys("i\<C-K>\x80\xfc\x2\x80\xfd\x3f\n", 'xt')
+   call feedkeys("i\<C-K>\x80\xfc\x4\x80\xfd\x3f\n", 'xt')
+   " Test for <xEnd>, <S-xEnd> and <C-xEnd>
+   call feedkeys("i\<C-K>\x80\xfd\x3d\n", 'xt')
+   call feedkeys("i\<C-K>\x80\xfc\x2\x80\xfd\x3d\n", 'xt')
+   call feedkeys("i\<C-K>\x80\xfc\x4\x80\xfd\x3d\n", 'xt')
+   " Test for <zHome>, <S-zHome> and <C-zHome>
+   call feedkeys("i\<C-K>\x80\xfd\x40\n", 'xt')
+   call feedkeys("i\<C-K>\x80\xfc\x2\x80\xfd\x40\n", 'xt')
+   call feedkeys("i\<C-K>\x80\xfc\x4\x80\xfd\x40\n", 'xt')
+   " Test for <zEnd>, <S-zEnd> and <C-zEnd>
+   call feedkeys("i\<C-K>\x80\xfd\x3e\n", 'xt')
+   call feedkeys("i\<C-K>\x80\xfc\x2\x80\xfd\x3e\n", 'xt')
+   call feedkeys("i\<C-K>\x80\xfc\x4\x80\xfd\x3e\n", 'xt')
+   " Test for <xUp>, <xDown>, <xLeft> and <xRight>
+   call feedkeys("i\<C-K>\x80\xfd\x41\n", 'xt')
+   call feedkeys("i\<C-K>\x80\xfd\x42\n", 'xt')
+   call feedkeys("i\<C-K>\x80\xfd\x43\n", 'xt')
+   call feedkeys("i\<C-K>\x80\xfd\x44\n", 'xt')
+   call assert_equal(['<Home>', '<S-Home>', '<C-Home>',
+         \ '<End>', '<S-End>', '<C-End>',
+         \ '<Home>', '<S-Home>', '<C-Home>',
+         \ '<End>', '<S-End>', '<C-End>',
+         \ '<Up>', '<Down>', '<Left>', '<Right>', ''], getline(1, '$'))
+   bw!
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.2642/src/testdir/test_undo.vim   2021-03-15 18:36:16.725494781 
+0100
--- src/testdir/test_undo.vim   2021-03-22 19:34:36.525309109 +0100
***************
*** 747,750 ****
--- 747,759 ----
    bwipe!
  endfunc
  
+ " Test for redo in insert mode using CTRL-O with multibyte characters
+ func Test_redo_multibyte_in_insert_mode()
+   new
+   call feedkeys("a\<C-K>ft", 'xt')
+   call feedkeys("uiHe\<C-O>.llo", 'xt')
+   call assert_equal("He\ufb05llo", getline(1))
+   bwipe!
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.2642/src/version.c       2021-03-22 18:22:24.626891593 +0100
--- src/version.c       2021-03-22 19:35:07.657248406 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2643,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
18. Your wife drapes a blond wig over your monitor to remind you of what she
    looks like.

 /// 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/202103221837.12MIbcrL2408449%40masaka.moolenaar.net.

Raspunde prin e-mail lui