diff src/testdir/test_history.vim @ 19570:43c04edcafec v8.2.0342

patch 8.2.0342: some code in ex_getln.c not covered by tests Commit: https://github.com/vim/vim/commit/0546d7df13b041833121b2d56036e1c62ea3b0c1 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 1 16:53:09 2020 +0100 patch 8.2.0342: some code in ex_getln.c not covered by tests Problem: Some code in ex_getln.c not covered by tests. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5717)
author Bram Moolenaar <Bram@vim.org>
date Sun, 01 Mar 2020 17:00:06 +0100
parents bab20768e1fd
children 848dc460adf0
line wrap: on
line diff
--- a/src/testdir/test_history.vim
+++ b/src/testdir/test_history.vim
@@ -114,6 +114,7 @@ function Test_Search_history_window()
   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,8 +123,9 @@ endfunc
 " Test for increasing the 'history' option value
 func Test_history_size()
   let save_histsz = &history
+  set history=10
+  call histadd(':', 'ls')
   call histdel(':')
-  set history=10
   for i in range(1, 5)
     call histadd(':', 'cmd' .. i)
   endfor
@@ -173,6 +175,13 @@ func Test_history_search()
   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