comparison 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
comparison
equal deleted inserted replaced
19580:e84b346be7f2 19581:848dc460adf0
48 call assert_equal([' 1', "1\<C-t>\<C-t>"], Ex("1\<C-t>\<C-t>\<C-d>"), e) 48 call assert_equal([' 1', "1\<C-t>\<C-t>"], Ex("1\<C-t>\<C-t>\<C-d>"), e)
49 call assert_equal([' foo', ' foo'], Ex(" foo\<C-d>"), e) 49 call assert_equal([' foo', ' foo'], Ex(" foo\<C-d>"), e)
50 call assert_equal(['foo', ' foo0'], Ex(" foo0\<C-d>"), e) 50 call assert_equal(['foo', ' foo0'], Ex(" foo0\<C-d>"), e)
51 call assert_equal(['foo', ' foo^'], Ex(" foo^\<C-d>"), e) 51 call assert_equal(['foo', ' foo^'], Ex(" foo^\<C-d>"), e)
52 call assert_equal(['foo', 'foo'], 52 call assert_equal(['foo', 'foo'],
53 \ Ex("\<BS>\<C-H>\<Del>foo"), e) 53 \ Ex("\<BS>\<C-H>\<Del>\<kDel>foo"), e)
54 " default wildchar <Tab> interferes with this test
55 set wildchar=<c-e>
56 call assert_equal(["a\tb", "a\tb"], Ex("a\t\t\<C-H>b"), e)
57 set wildchar&
54 endfor 58 endfor
55 59
56 set sw& 60 set sw&
57 let &encoding = encoding_save 61 let &encoding = encoding_save
58 endfunc 62 endfunc
137 call feedkeys("Qappend!\npqr\nxyz\n.\nvisual\n", 'xt') 141 call feedkeys("Qappend!\npqr\nxyz\n.\nvisual\n", 'xt')
138 call assert_equal(["\t abc", "\t pqr", "\t xyz"], getline(1, '$')) 142 call assert_equal(["\t abc", "\t pqr", "\t xyz"], getline(1, '$'))
139 close! 143 close!
140 endfunc 144 endfunc
141 145
146 " In Ex-mode, backslashes at the end of a command should be halved.
147 func Test_Ex_echo_backslash()
148 " This test works only when the language is English
149 if v:lang != "C" && v:lang !~ '^[Ee]n'
150 return
151 endif
152 let bsl = '\\\\'
153 let bsl2 = '\\\'
154 call assert_fails('call feedkeys("Qecho " .. bsl .. "\nvisual\n", "xt")',
155 \ "E15: Invalid expression: \\\\")
156 call assert_fails('call feedkeys("Qecho " .. bsl2 .. "\nm\nvisual\n", "xt")',
157 \ "E15: Invalid expression: \\\nm")
158 endfunc
159
142 " vim: shiftwidth=2 sts=2 expandtab 160 " vim: shiftwidth=2 sts=2 expandtab