Patch 8.1.2400
Problem:    Test39 is old style.
Solution:   Convert the test cases into new style. (Yegappan Lakshmanan,
            closes #5324)
Files:      src/Makefile, src/testdir/Make_all.mak, src/testdir/Make_vms.mms,
            src/testdir/test39.in, src/testdir/test39.ok,
            src/testdir/test_blockedit.vim, src/testdir/test_visual.vim


*** ../vim-8.1.2399/src/Makefile        2019-12-05 18:16:28.202179635 +0100
--- src/Makefile        2019-12-06 20:39:15.538296476 +0100
***************
*** 2251,2257 ****
  # These do not depend on the executable, compile it when needed.
  test1 \
        test_eval \
-       test39 \
        test42 test44 test49 \
        test52 test59 \
        test64 test69 \
--- 2253,2258 ----
*** ../vim-8.1.2399/src/testdir/Make_all.mak    2019-12-05 18:16:28.202179635 
+0100
--- src/testdir/Make_all.mak    2019-12-06 20:39:15.538296476 +0100
***************
*** 13,19 ****
  
  # Tests that run on all systems.
  SCRIPTS_ALL = \
-       test39.out \
        test42.out \
        test44.out \
        test64.out \
--- 13,18 ----
*** ../vim-8.1.2399/src/testdir/Make_vms.mms    2019-12-05 18:16:28.202179635 
+0100
--- src/testdir/Make_vms.mms    2019-12-06 20:39:15.538296476 +0100
***************
*** 74,80 ****
  .SUFFIXES : .out .in
  
  SCRIPT = test1.out \
-        test39.out \
         test42.out test44.out test49.out \
         test64.out test69.out \
         test72.out test77a.out test88.out \
--- 74,79 ----
*** ../vim-8.1.2399/src/testdir/test39.in       2015-08-04 21:16:02.000000000 
+0200
--- src/testdir/test39.in       1970-01-01 01:00:00.000000000 +0100
***************
*** 1,118 ****
- 
- Test Visual block mode commands
- And test "U" in Visual mode, also on German sharp S.
- 
- #define BO_ALL            0x0001
- #define BO_BS     0x0002
- #define BO_CRSR           0x0004
- 
- STARTTEST
- :so small.vim
- :so mbyte.vim
- :" This only works when 'encoding' is "latin1", don't depend on the 
environment
- :set enc=latin1
- /^abcde
- :" Test shift-right of a block
- jllll jj>wll jlll>
- :" Test shift-left of a block
- G$hhhh kk<
- :" Test block-insert
- Gkl kkkIxyz 
- :" Test block-replace
- Gllll kkklllrq
- :" Test block-change
- G$khhh hhkkcmno 
- :$-4,$w! test.out
- :" Test block-insert using cursor keys for movement
- /^aaaa/
- :exe ":norm! l\<C-V>jjjlllI\<Right>\<Right>  \<Esc>"
- :/^aa/,/^$/w >> test.out
- /xaaa$/
- :exe ":norm! \<C-V>jjjI<>\<Left>p\<Esc>"
- :/xaaa$/,/^$/w >> test.out
- :" Test for Visual block was created with the last <C-v>$
- /^A23$/
- :exe ":norm! l\<C-V>j$Aab\<Esc>"
- :.,/^$/w >> test.out
- :" Test for Visual block was created with the middle <C-v>$ (1)
- /^B23$/
- :exe ":norm! l\<C-V>j$hAab\<Esc>"
- :.,/^$/w >> test.out
- :" Test for Visual block was created with the middle <C-v>$ (2)
- /^C23$/
- :exe ":norm! l\<C-V>j$hhAab\<Esc>"
- :.,/^$/w >> test.out
- :" Test for Visual block insert when virtualedit=all and utf-8 encoding
- :set ve=all enc=utf-8
- :/\t\tline
- :exe ":norm! 07l\<C-V>jjIx\<Esc>"
- :.,/^$/w >> test.out
- :" Test for Visual block append when virtualedit=all
- :exe ":norm! 012l\<C-v>jjAx\<Esc>"
- :set ve= enc=latin1
- :.,/^$/w >> test.out
- :" gUe must uppercase a whole word, also when ß changes to SS
- Gothe youtußeuu end Ypk0wgUe
- :" gUfx must uppercase until x, inclusive.
- O- youßtußexu - 0fogUfx
- :" VU must uppercase a whole line
- YpkVU
- :" same, when it's the last line in the buffer
- YPGi111 VUddP
- :" Uppercase two lines
- Oblah di
- doh dut VkUj
- :" Uppercase part of two lines
- ddppi333 k0i222 fyllvjfuUk
- :" visual replace using Enter or NL
- G3o123456789 2k05l 2jr
G3o98765 2k02l 2jr 
- G3o123456789 2k05l 2jr
- G3o98765 2k02l 2jr 
- :"
- :" Test cursor position. When ve=block and Visual block mode and $gj
- :set ve=block
- :exe ":norm! 2k\<C-V>$gj\<Esc>"
- :let cpos=getpos("'>")
- :$put ='col:'.cpos[2].' off:'.cpos[3]
- :"
- :" block_insert when replacing spaces in front of the block with tabs
- :set ts=8 sts=4 sw=4
- :4,7y
- Gp
- :exe ":norm! f0\<C-V>2jI\<tab>\<esc>"
- :/^the/,$w >> test.out
- :qa!
- ENDTEST
- 
-               line1
-               line2
-               line3
- 
- aaaaaa
- bbbbbb
- cccccc
- dddddd
- 
- xaaa
- bbbb
- cccc
- dddd
- 
- yaaa
- ¿¿¿
- bbb
- 
- A23
- 4567
- 
- B23
- 4567
- 
- C23
- 4567
- 
- abcdefghijklm
- abcdefghijklm
- abcdefghijklm
- abcdefghijklm
- abcdefghijklm
--- 0 ----
*** ../vim-8.1.2399/src/testdir/test39.ok       2015-08-04 21:14:24.000000000 
+0200
--- src/testdir/test39.ok       1970-01-01 01:00:00.000000000 +0100
***************
*** 1,63 ****
- axyzbcdefghijklm
- axyzqqqq   mno              ghijklm
- axyzqqqqef mno        ghijklm
- axyzqqqqefgmnoklm
- abcdqqqqijklm
- aaa  aaa
- bbb  bbb
- ccc  ccc
- ddd  ddd
- 
- <p>xaaa
- <p>bbbb
- <p>cccc
- <p>dddd
- 
- A23ab
- 4567ab
- 
- B23 ab
- 4567ab
- 
- C23ab
- 456ab7
- 
-        x      line1
-        x      line2
-        x      line3
- 
-        x     x   line1
-        x     x   line2
-        x     x   line3
- 
- the YOUTUSSEUU end
- - yOUSSTUSSEXu -
- THE YOUTUSSEUU END
- 111THE YOUTUSSEUU END
- BLAH DI
- DOH DUT
- 222the yoUTUSSEUU END
- 333THE YOUTUßeuu end
- 12345
- 789
- 12345
- 789
- 12345
- 789
- 98
65
- 98
65
- 98
65
- 12345
- 789
- 12345
- 789
- 12345
- 789
- 98(['B23 ab', '4567ab'], getline(1, 2))
+ 
+   " Test for Visual block was created with the middle <C-v>$ (2)
+   call deletebufline('', 1, '$')
+   call setline(1, ['C23', '4567'])
+   call cursor(1, 1)
+   exe "norm! l\<C-V>j$hhAab\<Esc>"
+   call assert_equal(['C23ab', '456ab7'], getline(1, 2))
+   bwipe!
+ endfunc
+ 
+ " Test for Visual block insert when virtualedit=all
+ func Test_virtualedit_visual_block()
+   set ve=all
+   new
+   call append(0, ["\t\tline1", "\t\tline2", "\t\tline3"])
+   call cursor(1, 1)
+   exe "norm! 07l\<C-V>jjIx\<Esc>"
+   call assert_equal(["       x \tline1",
+         \ "       x \tline2",
+         \ "       x \tline3"], getline(1, 3))
+ 
+   " Test for Visual block append when virtualedit=all
+   exe "norm! 012l\<C-v>jjAx\<Esc>"
+   call assert_equal(['       x     x   line1',
+         \ '       x     x   line2',
+         \ '       x     x   line3'], getline(1, 3))
+   set ve=
+   bwipe!
+ endfunc
+ 
+ " Test for changing case
+ func Test_visual_change_case()
+   new
+   " gUe must uppercase a whole word, also when ß changes to SS
+   exe "normal Gothe youtußeuu end\<Esc>Ypk0wgUe\r"
+   " gUfx must uppercase until x, inclusive.
+   exe "normal O- youßtußexu -\<Esc>0fogUfx\r"
+   " VU must uppercase a whole line
+   exe "normal YpkVU\r"
+   " same, when it's the last line in the buffer
+   exe "normal YPGi111\<Esc>VUddP\r"
+   " Uppercase two lines
+   exe "normal Oblah di\rdoh dut\<Esc>VkUj\r"
+   " Uppercase part of two lines
+   exe "normal ddppi333\<Esc>k0i222\<Esc>fyllvjfuUk"
+   call assert_equal(['the YOUTUSSEUU end', '- yOUSSTUSSEXu -',
+         \ 'THE YOUTUSSEUU END', '111THE YOUTUSSEUU END', 'BLAH DI', 'DOH DUT',
+         \ '222the yoUTUSSEUU END', '333THE YOUTUßeuu end'], getline(2, '$'))
+   bwipe!
+ endfunc
+ 
+ " Test for Visual replace using Enter or NL
+ func Test_visual_replace_crnl()
+   new
+   exe "normal G3o123456789\e2k05l\<C-V>2jr\r"
+   exe "normal G3o98765\e2k02l\<C-V>2jr\<C-V>\r\n"
+   exe "normal G3o123456789\e2k05l\<C-V>2jr\n"
+   exe "normal G3o98765\e2k02l\<C-V>2jr\<C-V>\n"
+   call assert_equal(['12345', '789', '12345', '789', '12345', '789', "98\r65",
+         \ "98\r65", "98\r65", '12345', '789', '12345', '789', '12345', '789',
+         \ "98\n65", "98\n65", "98\n65"], getline(2, '$'))
+   bwipe!
+ endfunc
+ 
+ func Test_ve_block_curpos()
+   new
+   " Test cursor position. When ve=block and Visual block mode and $gj
+   call append(0, ['12345', '789'])
+   call cursor(1, 3)
+   set virtualedit=block
+   exe "norm! \<C-V>$gj\<Esc>"
+   call assert_equal([0, 2, 4, 0], getpos("'>"))
+   set virtualedit=
+   bwipe!
+ endfunc
+ 
+ " Test for block_insert when replacing spaces in front of the a with tabs
+ func Test_block_insert_replace_tabs()
+   new
+   set ts=8 sts=4 sw=4
+   call append(0, ["#define BO_ALL\t    0x0001",
+         \ "#define BO_BS\t    0x0002",
+         \ "#define BO_CRSR\t    0x0004"])
+   call cursor(1, 1)
+   exe "norm! f0\<C-V>2jI\<tab>\<esc>"
+   call assert_equal([
+         \ "#define BO_ALL\t\t0x0001",
+         \ "#define BO_BS\t    \t0x0002",
+         \ "#define BO_CRSR\t    \t0x0004", ''], getline(1, '$'))
+   set ts& sts& sw&
+   bwipe!
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.1.2399/src/version.c       2019-12-06 20:17:20.379094586 +0100
--- src/version.c       2019-12-06 20:41:23.133807334 +0100
***************
*** 744,745 ****
--- 744,747 ----
  {   /* Add new patch number below this line */
+ /**/
+     2400,
  /**/

-- 
Spam seems to be something useful to novices.  Later you realize that
it's a bunch of indigestable junk that only clogs your system.
Applies to both the food and the e-mail!

 /// 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/201912061944.xB6JiOTS000701%40masaka.moolenaar.net.

Raspunde prin e-mail lui