summaryrefslogtreecommitdiff
path: root/src/testdir/test_ex_mode.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-03-02 20:54:22 +0100
committerBram Moolenaar <Bram@vim.org>2020-03-02 20:54:22 +0100
commit91ffc8a5f5c7b1c6979b3352a12ed779d11173a9 (patch)
tree6ad08faaa3709ac3982b2324e98c5816dd567687 /src/testdir/test_ex_mode.vim
parent61a6d4e48b4778bdbc741af8ac59519b70f65db8 (diff)
downloadvim-git-91ffc8a5f5c7b1c6979b3352a12ed779d11173a9.tar.gz
patch 8.2.0347: various code not covered by testsv8.2.0347
Problem: Various code not covered by tests. Solution: Add more test coverage. (Yegappan Lakshmanan, closes #5720)
Diffstat (limited to 'src/testdir/test_ex_mode.vim')
-rw-r--r--src/testdir/test_ex_mode.vim20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/testdir/test_ex_mode.vim b/src/testdir/test_ex_mode.vim
index e88bdf530..e54e31621 100644
--- 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