From af23d173883f47fd02a9a380c719e4428370b484 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Tue, 7 Mar 2023 04:13:04 +0100 Subject: test: move oldtests to test directory (#22536) The new oldtest directory is in test/old/testdir. The reason for this is that many tests have hardcoded the parent directory name to be 'testdir'. --- test/old/testdir/test_ex_equal.vim | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/old/testdir/test_ex_equal.vim (limited to 'test/old/testdir/test_ex_equal.vim') diff --git a/test/old/testdir/test_ex_equal.vim b/test/old/testdir/test_ex_equal.vim new file mode 100644 index 0000000000..05ad276836 --- /dev/null +++ b/test/old/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 From a92b38934a2d00c13ee4d1969d994da15e0857ab Mon Sep 17 00:00:00 2001 From: bfredl Date: Mon, 20 Mar 2023 21:11:10 +0100 Subject: feat(lua): allow `:=expr` as a shorter version of `:lua =expr` existing behavior of := and :[range]= are unchanged. `|` is still allowed with this usage. However, :=p and similar are changed in a way which could be construed as a breaking change. Allowing |ex-flags| for := in the first place was a mistake as any form of := DOES NOT MOVE THE CURSOR. So it would print one line number and then print a completely different line contents after that. --- test/old/testdir/test_ex_equal.vim | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'test/old/testdir/test_ex_equal.vim') diff --git a/test/old/testdir/test_ex_equal.vim b/test/old/testdir/test_ex_equal.vim index 05ad276836..32e23704eb 100644 --- a/test/old/testdir/test_ex_equal.vim +++ b/test/old/testdir/test_ex_equal.vim @@ -7,6 +7,19 @@ func Test_ex_equal() let a = execute('=') call assert_equal("\n2", a) + let a = execute('.=') + call assert_equal("\n1", a) + + call assert_fails('3=', 'E16:') + bwipe! +endfunc + +func Test_ex_equal_arg() + throw 'skipped: Nvim evaluates lua with := [arg]' + + new + call setline(1, ["foo\tbar", "bar\tfoo"]) + let a = execute('=#') call assert_equal("\n2\n 1 foo bar", a) @@ -22,10 +35,6 @@ func Test_ex_equal() 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! -- cgit