diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-04-20 22:01:41 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-04-20 22:01:41 +0200 |
commit | 5d69da462f584a3aefb3427b127334bf9af3a4b0 (patch) | |
tree | 05427fccf4d57a03629b4f45b8cae2d5b10c9cea /src/testdir/test_arglist.vim | |
parent | 02e802b2da9e25b5824185976b163691b5bbd558 (diff) |
patch 8.0.1738: ":args" output is hard to readv8.0.1738
Problem: ":args" output is hard to read.
Solution: Make columns with the names if the output is more than one line.
Diffstat (limited to 'src/testdir/test_arglist.vim')
-rw-r--r-- | src/testdir/test_arglist.vim | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/testdir/test_arglist.vim b/src/testdir/test_arglist.vim index 19d0cee47a..4b8d762e97 100644 --- a/src/testdir/test_arglist.vim +++ b/src/testdir/test_arglist.vim @@ -122,9 +122,9 @@ func Test_argument() call assert_equal(['d', 'c', 'b', 'a', 'c'], g:buffers) redir => result - ar + args redir END - call assert_true(result =~# 'a b \[c] d') + call assert_equal('a b [c] d', trim(result)) .argd call assert_equal(['a', 'b', 'd'], argv()) @@ -170,6 +170,34 @@ func Test_argument() call assert_fails('argument', 'E163:') endfunc +func Test_list_arguments() + " Clean the argument list + arga a | %argd + + " four args half the screen width makes two lines with two columns + let aarg = repeat('a', &columns / 2 - 4) + let barg = repeat('b', &columns / 2 - 4) + let carg = repeat('c', &columns / 2 - 4) + let darg = repeat('d', &columns / 2 - 4) + exe 'argadd ' aarg barg carg darg + + redir => result + args + redir END + call assert_match('\[' . aarg . '] \+' . carg . '\n' . barg . ' \+' . darg, trim(result)) + + " if one arg is longer than half the screen make one column + exe 'argdel' aarg + let aarg = repeat('a', &columns / 2 + 2) + exe '0argadd' aarg + redir => result + args + redir END + call assert_match(aarg . '\n\[' . barg . ']\n' . carg . '\n' . darg, trim(result)) + + %argdelete +endfunc + " Test for 0argadd and 0argedit " Ported from the test_argument_0count.in test script func Test_zero_argadd() |