]> granicus.if.org Git - vim/commitdiff
patch 9.0.0059: test file has wrong name v9.0.0059
authorzeertzjq <zeertzjq@outlook.com>
Sat, 23 Jul 2022 05:25:29 +0000 (06:25 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 23 Jul 2022 05:25:29 +0000 (06:25 +0100)
Problem:    Test file has wrong name.
Solution:   Rename the file.  Various small fixes. (closes #10674)

src/getchar.c
src/testdir/Make_all.mak
src/testdir/test_alot.vim
src/testdir/test_input.vim [moved from src/testdir/test_feedkeys.vim with 57% similarity]
src/testdir/test_options.vim
src/testdir/test_statusline.vim
src/testdir/test_termcodes.vim
src/testdir/test_timers.vim
src/version.c
src/vim.h

index 419ce7468e483be261527fb26f3dccfe2f4a51ee..fc15daaf7dc4efb1a5853e0dc76add6e7a11c0b7 100644 (file)
@@ -2436,7 +2436,7 @@ handle_mapping(
     int                local_State = get_real_state();
     int                is_plug_map = FALSE;
 
-    // If typehead starts with <Plug> then remap, even for a "noremap" mapping.
+    // If typeahead starts with <Plug> then remap, even for a "noremap" mapping.
     if (typebuf.tb_len >= 3
            && typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL
            && typebuf.tb_buf[typebuf.tb_off + 1] == KS_EXTRA
index bc286321f9fdbb62252cec2590a1873f86056d25..dbda7e15f3782e446b6023aa280ae95e5e81cf1a 100644 (file)
@@ -125,7 +125,6 @@ NEW_TESTS = \
        test_expand_func \
        test_expr \
        test_expr_utf8 \
-       test_feedkeys \
        test_file_perm \
        test_file_size \
        test_filechanged \
@@ -164,6 +163,7 @@ NEW_TESTS = \
        test_increment \
        test_increment_dbcs \
        test_indent \
+       test_input \
        test_ins_complete \
        test_ins_complete_no_halt \
        test_interrupt \
@@ -408,6 +408,7 @@ NEW_TESTS_RES = \
        test_increment.res \
        test_increment_dbcs.res \
        test_indent.res \
+       test_input.res \
        test_ins_complete.res \
        test_ins_complete_no_halt.res \
        test_interrupt.res \
index 845c117f65b8bf422659d753920ab9313f30fb1f..46af3449b955d8cd0275064af7cede1cf008ff71 100644 (file)
@@ -11,7 +11,6 @@ source test_ex_mode.vim
 source test_expand.vim
 source test_expand_dllpath.vim
 source test_expand_func.vim
-source test_feedkeys.vim
 source test_file_perm.vim
 source test_fnamemodify.vim
 source test_ga.vim
similarity index 57%
rename from src/testdir/test_feedkeys.vim
rename to src/testdir/test_input.vim
index fb64711863050844aaeadd0c2c725f14c3d28595..3b1e2eb2df4672a1a107a9a12f34ca2656a4ab43 100644 (file)
@@ -1,4 +1,4 @@
-" Test feedkeys() function.
+" Tests for character input and feedkeys() function.
 
 func Test_feedkeys_x_with_empty_string()
   new
@@ -34,4 +34,28 @@ func Test_feedkeys_escape_special()
   nunmap …
 endfunc
 
+func Test_input_simplify_ctrl_at()
+  new
+  " feeding unsimplified CTRL-@ should still trigger i_CTRL-@
+  call feedkeys("ifoo\<Esc>A\<*C-@>x", 'xt')
+  call assert_equal('foofo', getline(1))
+  bw!
+endfunc
+
+func Test_input_simplify_noremap()
+  call feedkeys("i\<*C-M>", 'nx')
+  call assert_equal('', getline(1))
+  call assert_equal([0, 2, 1, 0, 1], getcurpos())
+  bw!
+endfunc
+
+func Test_input_simplify_timedout()
+  inoremap <C-M>a b
+  call feedkeys("i\<*C-M>", 'xt')
+  call assert_equal('', getline(1))
+  call assert_equal([0, 2, 1, 0, 1], getcurpos())
+  iunmap <C-M>a
+  bw!
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
index fbe592d16519f52c7373553611bff161d2ad10c3..01418bd6d69574669072957a3daa288178a71491 100644 (file)
@@ -65,7 +65,9 @@ func Test_pastetoggle()
   let &pastetoggle = str
   call assert_equal(str, &pastetoggle)
   call assert_equal("\n  pastetoggle=" .. strtrans(str), execute('set pastetoggle?'))
+
   unlet str
+  set pastetoggle&
 endfunc
 
 func Test_wildchar()
@@ -899,7 +901,6 @@ endfunc
 func Test_rightleftcmd()
   CheckFeature rightleft
   set rightleft
-  set rightleftcmd
 
   let g:l = []
   func AddPos()
@@ -908,6 +909,13 @@ func Test_rightleftcmd()
   endfunc
   cmap <expr> <F2> AddPos()
 
+  set rightleftcmd=
+  call feedkeys("/\<F2>abc\<Right>\<F2>\<Left>\<Left>\<F2>" ..
+        \ "\<Right>\<F2>\<Esc>", 'xt')
+  call assert_equal([2, 5, 3, 4], g:l)
+
+  let g:l = []
+  set rightleftcmd=search
   call feedkeys("/\<F2>abc\<Left>\<F2>\<Right>\<Right>\<F2>" ..
         \ "\<Left>\<F2>\<Esc>", 'xt')
   call assert_equal([&co - 1, &co - 4, &co - 2, &co - 3], g:l)
index 7c75f61a871431d5f2fbdac747e6988629f69c28..e60140fe2c79efbb4a50e5b9726454802424ffbb 100644 (file)
@@ -7,6 +7,14 @@ source view_util.vim
 source check.vim
 source screendump.vim
 
+func SetUp()
+  set laststatus=2
+endfunc
+
+func TearDown()
+  set laststatus&
+endfunc
+
 func s:get_statusline()
   return ScreenLines(&lines - 1, &columns)[0]
 endfunc
@@ -35,7 +43,6 @@ endfunc
 
 func Test_caught_error_in_statusline()
   let s:func_in_statusline_called = 0
-  set laststatus=2
   let statusline = '%{StatuslineWithCaughtError()}'
   let &statusline = statusline
   redrawstatus
@@ -46,7 +53,6 @@ endfunc
 
 func Test_statusline_will_be_disabled_with_error()
   let s:func_in_statusline_called = 0
-  set laststatus=2
   let statusline = '%{StatuslineWithError()}'
   try
     let &statusline = statusline
@@ -73,7 +79,6 @@ func Test_statusline()
   call assert_match('^ ((2) of 2)\s*$', s:get_statusline())
 
   only
-  set laststatus=2
   set splitbelow
   call setline(1, range(1, 10000))
 
@@ -432,7 +437,6 @@ func Test_statusline()
   %bw!
   call delete('Xstatusline')
   set statusline&
-  set laststatus&
   set splitbelow&
 endfunc
 
@@ -518,7 +522,6 @@ endfunc
 " with a custom 'statusline'
 func Test_statusline_mbyte_fillchar()
   only
-  set laststatus=2
   set fillchars=vert:\|,fold:-,stl:━,stlnc:═
   set statusline=a%=b
   call assert_match('^a\+━\+b$', s:get_statusline())
@@ -526,7 +529,7 @@ func Test_statusline_mbyte_fillchar()
   call assert_match('^a\+━\+b━a\+═\+b$', s:get_statusline())
   wincmd w
   call assert_match('^a\+═\+b═a\+━\+b$', s:get_statusline())
-  set statusline& fillchars& laststatus&
+  set statusline& fillchars&
   %bw!
 endfunc
 
index 87c04745a10ededa1c467d6cebba32a3a5e260d3..6e4bbd19ca93abb19cdbb83e5850f42f21407b87 100644 (file)
@@ -2437,28 +2437,5 @@ func Test_terminal_builtin_without_gui()
   call assert_notequal(-1, index(output, 'builtin_dumb'))
 endfunc
 
-func Test_simplify_ctrl_at()
-  " feeding unsimplified CTRL-@ should still trigger i_CTRL-@
-  call feedkeys("ifoo\<Esc>A\<*C-@>x", 'xt')
-  call assert_equal('foofo', getline(1))
-  bw!
-endfunc
-
-func Test_simplify_noremap()
-  call feedkeys("i\<*C-M>", 'nx')
-  call assert_equal('', getline(1))
-  call assert_equal([0, 2, 1, 0, 1], getcurpos())
-  bw!
-endfunc
-
-func Test_simplify_timedout()
-  inoremap <C-M>a b
-  call feedkeys("i\<*C-M>", 'xt')
-  call assert_equal('', getline(1))
-  call assert_equal([0, 2, 1, 0, 1], getcurpos())
-  iunmap <C-M>a
-  bw!
-endfunc
-
 
 " vim: shiftwidth=2 sts=2 expandtab
index 7a5cc29f5ac0fa9434e946246e6b4ab7590d5636..338be10ff6fc7315fff3ff2bfa886adde8b4a5b4 100644 (file)
@@ -369,7 +369,7 @@ endfunc
 
 " Test that the garbage collector isn't triggered if a timer callback invokes
 " vgetc().
-func Test_timer_nocatch_garbage_collect()
+func Test_nocatch_timer_garbage_collect()
   " 'uptimetime. must be bigger than the timer timeout
   set ut=200
   call test_garbagecollect_soon()
index 4db3a24ae544bf2ad48f9cc1425ebd2f003809be..b57ab6985f515a86a30f218cbc06a19d1462ddb3 100644 (file)
@@ -735,6 +735,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    59,
 /**/
     58,
 /**/
index a4da18505ccd8cbcb4fffb12e223d1d17019689c..eeeeb692128c5971e84df0b2c81d5f11fb0cb32e 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -2819,7 +2819,7 @@ long elapsed(DWORD start_tick);
 #define UC_BUFFER      1       // -buffer: local to current buffer
 #define UC_VIM9                2       // {} argument: Vim9 syntax.
 
-// flags used by vim_strsave_escaped()
+// flags used by vim_strsave_fnameescape()
 #define VSE_NONE       0
 #define VSE_SHELL      1       // escape for a shell command
 #define VSE_BUFFER     2       // escape for a ":buffer" command