From e0348c610c5f84c03f69f638effab27d0c784c7f Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 25 May 2019 14:52:34 -0400 Subject: vim-patch:8.1.0817: test ":=" command #10062 Problem: ":=" command is not tested. Solution: Add a test. (Dominique Pelle, closes vim/vim#3859) https://github.com/vim/vim/commit/99531a7604ce89ba82f41cdb519669abb61f3df0 --- src/nvim/testdir/test_ex_equal.vim | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/nvim/testdir/test_ex_equal.vim (limited to 'src/nvim/testdir/test_ex_equal.vim') diff --git a/src/nvim/testdir/test_ex_equal.vim b/src/nvim/testdir/test_ex_equal.vim new file mode 100644 index 0000000000..05ad276836 --- /dev/null +++ b/src/nvim/testdir/test_ex_equal.vim @@ -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 -- cgit