diff src/testdir/test_tagjump.vim @ 19625:f70a3c1000bb v8.2.0369

patch 8.2.0369: various Normal mode commands not fully tested Commit: https://github.com/vim/vim/commit/1671f4488105ee12a6a8558ae351436c26ab55fc Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 10 07:48:13 2020 +0100 patch 8.2.0369: various Normal mode commands not fully tested Problem: Various Normal mode commands not fully tested. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5751)
author Bram Moolenaar <Bram@vim.org>
date Tue, 10 Mar 2020 08:00:06 +0100
parents 67fbe280a502
children c087099e9163
line wrap: on
line diff
--- a/src/testdir/test_tagjump.vim
+++ b/src/testdir/test_tagjump.vim
@@ -1140,7 +1140,7 @@ endfunc
 
 " Test for :dsearch, :dlist, :djump and :dsplit commands
 " Test for [d, ]d, [D, ]D, [ CTRL-D, ] CTRL-D and CTRL-W d commands
-func Test_def_search()
+func Test_macro_search()
   new
   call setline(1, ['#define FOO 1', '#define FOO 2', '#define FOO 3',
         \ '#define FOO 4', '#define FOO 5'])
@@ -1236,4 +1236,35 @@ func Test_def_search()
   close!
 endfunc
 
+" Test for [*, [/, ]* and ]/
+func Test_comment_search()
+  new
+  call setline(1, ['', '/*', ' *', ' *', ' */'])
+  normal! 4gg[/
+  call assert_equal([2, 1], [line('.'), col('.')])
+  normal! 3gg[*
+  call assert_equal([2, 1], [line('.'), col('.')])
+  normal! 3gg]/
+  call assert_equal([5, 3], [line('.'), col('.')])
+  normal! 3gg]*
+  call assert_equal([5, 3], [line('.'), col('.')])
+  %d
+  call setline(1, ['', '/*', ' *', ' *'])
+  call assert_beeps('normal! 3gg]/')
+  %d
+  call setline(1, ['', ' *', ' *', ' */'])
+  call assert_beeps('normal! 4gg[/')
+  %d
+  call setline(1, '        /* comment */')
+  normal! 15|[/
+  call assert_equal(9, col('.'))
+  normal! 15|]/
+  call assert_equal(21, col('.'))
+  call setline(1, '         comment */')
+  call assert_beeps('normal! 15|[/')
+  call setline(1, '        /* comment')
+  call assert_beeps('normal! 15|]/')
+  close!
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab