diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-03-16 22:52:32 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-03-16 22:52:32 +0100 |
commit | 8c34aa09a449a5c1c2d1141b6fafa90f29b3fc12 (patch) | |
tree | c8f6eb725fffad7567d6484c61a00ad28e3c8acd | |
parent | c537947100d4a73754ad4b4c9228c6c439655e5d (diff) | |
download | vim-8c34aa09a449a5c1c2d1141b6fafa90f29b3fc12.zip |
patch 8.0.0473: no test covering arg_all()
Problem: No test covering arg_all().
Solution: Add a test expanding ##.
-rw-r--r-- | src/testdir/test_arglist.vim | 47 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 29 insertions, 20 deletions
diff --git a/src/testdir/test_arglist.vim b/src/testdir/test_arglist.vim index d18035b3b..dee2d6506 100644 --- a/src/testdir/test_arglist.vim +++ b/src/testdir/test_arglist.vim @@ -90,7 +90,7 @@ endfunc " Test for [count]argument and [count]argdelete commands " Ported from the test_argument_count.in test script -function Test_argument() +func Test_argument() " Clean the argument list arga a | %argd @@ -162,11 +162,11 @@ function Test_argument() %argdelete call assert_fails('argument', 'E163:') -endfunction +endfunc " Test for 0argadd and 0argedit " Ported from the test_argument_0count.in test script -function Test_zero_argadd() +func Test_zero_argadd() " Clean the argument list arga a | %argd @@ -188,22 +188,22 @@ function Test_zero_argadd() 2argu arga third call assert_equal(['edited', 'a', 'third', 'b', 'c', 'd'], argv()) -endfunction +endfunc -function Reset_arglist() +func Reset_arglist() args a | %argd -endfunction +endfunc " Test for argc() -function Test_argc() +func Test_argc() call Reset_arglist() call assert_equal(0, argc()) argadd a b call assert_equal(2, argc()) -endfunction +endfunc " Test for arglistid() -function Test_arglistid() +func Test_arglistid() call Reset_arglist() arga a b call assert_equal(0, arglistid()) @@ -218,19 +218,19 @@ function Test_arglistid() tabonly | only | enew! argglobal call assert_equal(0, arglistid()) -endfunction +endfunc " Test for argv() -function Test_argv() +func Test_argv() call Reset_arglist() call assert_equal([], argv()) call assert_equal("", argv(2)) argadd a b c d call assert_equal('c', argv(2)) -endfunction +endfunc " Test for the :argedit command -function Test_argedit() +func Test_argedit() call Reset_arglist() argedit a call assert_equal(['a'], argv()) @@ -254,10 +254,10 @@ function Test_argedit() argedit! y call assert_equal(['x', 'y', 'a', 'c', 'b'], argv()) %argd -endfunction +endfunc " Test for the :argdelete command -function Test_argdelete() +func Test_argdelete() call Reset_arglist() args aa a aaa b bb argdelete a* @@ -269,10 +269,10 @@ function Test_argdelete() call assert_fails('argdelete', 'E471:') call assert_fails('1,100argdelete', 'E16:') %argd -endfunction +endfunc " Tests for the :next, :prev, :first, :last, :rewind commands -function Test_argpos() +func Test_argpos() call Reset_arglist() args a b c d last @@ -290,10 +290,10 @@ function Test_argpos() rewind call assert_equal(0, argidx()) %argd -endfunction +endfunc " Test for autocommand that redefines the argument list, when doing ":all". -function Test_arglist_autocmd() +func Test_arglist_autocmd() autocmd BufReadPost Xxx2 next Xxx2 Xxx1 call writefile(['test file Xxx1'], 'Xxx1') call writefile(['test file Xxx2'], 'Xxx2') @@ -319,4 +319,11 @@ function Test_arglist_autocmd() call delete('Xxx3') argdelete Xxx* bwipe! Xxx1 Xxx2 Xxx3 -endfunction +endfunc + +func Test_arg_all_expand() + call writefile(['test file Xxx1'], 'Xx x') + next notexist Xx\ x runtest.vim + call assert_equal('notexist Xx\ x runtest.vim', expand('##')) + call delete('Xx x') +endfunc diff --git a/src/version.c b/src/version.c index e4a40f20f..8237679a1 100644 --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 473, +/**/ 472, /**/ 471, |