mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 03:16:31 +00:00
vim-patch:8.1.0817: test ":=" command #10062
Problem: ":=" command is not tested.
Solution: Add a test. (Dominique Pelle, closes vim/vim#3859)
99531a7604
This commit is contained in:

committed by
Justin M. Keyes

parent
5d6a18f238
commit
e0348c610c
@@ -7,6 +7,7 @@ source test_cd.vim
|
|||||||
source test_changedtick.vim
|
source test_changedtick.vim
|
||||||
source test_compiler.vim
|
source test_compiler.vim
|
||||||
source test_cursor_func.vim
|
source test_cursor_func.vim
|
||||||
|
source test_ex_equal.vim
|
||||||
source test_ex_undo.vim
|
source test_ex_undo.vim
|
||||||
source test_ex_z.vim
|
source test_ex_z.vim
|
||||||
source test_execute_func.vim
|
source test_execute_func.vim
|
||||||
|
32
src/nvim/testdir/test_ex_equal.vim
Normal file
32
src/nvim/testdir/test_ex_equal.vim
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
" Test Ex := command.
|
||||||
|
|
||||||
|
func Test_ex_equal()
|
||||||
|
new
|
||||||
|
call setline(1, ["foo\tbar", "bar\tfoo"])
|
||||||
|
|
||||||
|
let a = execute('=')
|
||||||
|
call assert_equal("\n2", a)
|
||||||
|
|
||||||
|
let a = execute('=#')
|
||||||
|
call assert_equal("\n2\n 1 foo bar", a)
|
||||||
|
|
||||||
|
let a = execute('=l')
|
||||||
|
call assert_equal("\n2\nfoo^Ibar$", a)
|
||||||
|
|
||||||
|
let a = execute('=p')
|
||||||
|
call assert_equal("\n2\nfoo bar", a)
|
||||||
|
|
||||||
|
let a = execute('=l#')
|
||||||
|
call assert_equal("\n2\n 1 foo^Ibar$", a)
|
||||||
|
|
||||||
|
let a = execute('=p#')
|
||||||
|
call assert_equal("\n2\n 1 foo bar", a)
|
||||||
|
|
||||||
|
let a = execute('.=')
|
||||||
|
call assert_equal("\n1", a)
|
||||||
|
|
||||||
|
call assert_fails('3=', 'E16:')
|
||||||
|
call assert_fails('=x', 'E488:')
|
||||||
|
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
Reference in New Issue
Block a user