diff src/testdir/test_ex_mode.vim @ 19370:02111977dd05 v8.2.0243

patch 8.2.0243: insufficient code coverage for ex_docmd.c functions Commit: https://github.com/vim/vim/commit/9f6277bdde97b7767ded43a0b5a2023eb601b3b7 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 11 22:04:02 2020 +0100 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions Problem: Insufficient code coverage for ex_docmd.c functions. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5618)
author Bram Moolenaar <Bram@vim.org>
date Tue, 11 Feb 2020 22:15:04 +0100
parents 2f0f308c069c
children 67fbe280a502
line wrap: on
line diff
--- a/src/testdir/test_ex_mode.vim
+++ b/src/testdir/test_ex_mode.vim
@@ -84,4 +84,26 @@ func Test_Ex_substitute()
   call StopVimInTerminal(buf)
 endfunc
 
+" Test for displaying lines from an empty buffer in Ex mode
+func Test_Ex_emptybuf()
+  new
+  call assert_fails('call feedkeys("Q\<CR>", "xt")', 'E749:')
+  call setline(1, "abc")
+  call assert_fails('call feedkeys("Q\<CR>", "xt")', 'E501:')
+  call assert_fails('call feedkeys("Q%d\<CR>", "xt")', 'E749:')
+  close!
+endfunc
+
+" Test for the :open command
+func Test_open_command()
+  new
+  call setline(1, ['foo foo', 'foo bar', 'foo baz'])
+  call feedkeys("Qopen\<CR>j", 'xt')
+  call assert_equal('foo bar', getline('.'))
+  call feedkeys("Qopen /bar/\<CR>", 'xt')
+  call assert_equal(5, col('.'))
+  call assert_fails('call feedkeys("Qopen /baz/\<CR>", "xt")', 'E479:')
+  close!
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab