Mercurial > vim
diff src/testdir/test_ex_mode.vim @ 19581:848dc460adf0 v8.2.0347
patch 8.2.0347: various code not covered by tests
Commit: https://github.com/vim/vim/commit/91ffc8a5f5c7b1c6979b3352a12ed779d11173a9
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Mar 2 20:54:22 2020 +0100
patch 8.2.0347: various code not covered by tests
Problem: Various code not covered by tests.
Solution: Add more test coverage. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5720)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 02 Mar 2020 21:00:04 +0100 |
parents | 43c04edcafec |
children | 6d3c683466f4 |
line wrap: on
line diff
--- a/src/testdir/test_ex_mode.vim +++ b/src/testdir/test_ex_mode.vim @@ -50,7 +50,11 @@ func Test_ex_mode() call assert_equal(['foo', ' foo0'], Ex(" foo0\<C-d>"), e) call assert_equal(['foo', ' foo^'], Ex(" foo^\<C-d>"), e) call assert_equal(['foo', 'foo'], - \ Ex("\<BS>\<C-H>\<Del>foo"), e) + \ Ex("\<BS>\<C-H>\<Del>\<kDel>foo"), e) + " default wildchar <Tab> interferes with this test + set wildchar=<c-e> + call assert_equal(["a\tb", "a\tb"], Ex("a\t\t\<C-H>b"), e) + set wildchar& endfor set sw& @@ -139,4 +143,18 @@ func Test_Ex_append() close! endfunc +" In Ex-mode, backslashes at the end of a command should be halved. +func Test_Ex_echo_backslash() + " This test works only when the language is English + if v:lang != "C" && v:lang !~ '^[Ee]n' + return + endif + let bsl = '\\\\' + let bsl2 = '\\\' + call assert_fails('call feedkeys("Qecho " .. bsl .. "\nvisual\n", "xt")', + \ "E15: Invalid expression: \\\\") + call assert_fails('call feedkeys("Qecho " .. bsl2 .. "\nm\nvisual\n", "xt")', + \ "E15: Invalid expression: \\\nm") +endfunc + " vim: shiftwidth=2 sts=2 expandtab