diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-02-11 22:04:02 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-02-11 22:04:02 +0100 |
commit | 9f6277bdde97b7767ded43a0b5a2023eb601b3b7 (patch) | |
tree | f80204a06b9c411a154597c112f51d81a66d1d50 /src/testdir/test_ex_mode.vim | |
parent | 799439a5d85a7d45eff7485056f2798cea766300 (diff) | |
download | vim-git-9f6277bdde97b7767ded43a0b5a2023eb601b3b7.tar.gz |
patch 8.2.0243: insufficient code coverage for ex_docmd.c functionsv8.2.0243
Problem: Insufficient code coverage for ex_docmd.c functions.
Solution: Add more tests. (Yegappan Lakshmanan, closes #5618)
Diffstat (limited to 'src/testdir/test_ex_mode.vim')
-rw-r--r-- | src/testdir/test_ex_mode.vim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testdir/test_ex_mode.vim b/src/testdir/test_ex_mode.vim index 5899571a9..7861477c7 100644 --- 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 |