]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.1043: %a item in 'statusline' not tested v8.2.1043
authorBram Moolenaar <Bram@vim.org>
Tue, 23 Jun 2020 18:00:50 +0000 (20:00 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 23 Jun 2020 18:00:50 +0000 (20:00 +0200)
Problem:    %a item in 'statusline' not tested.
Solution:   Add a test. (Dominique PellĂ©, closes #6318)

src/testdir/test_statusline.vim
src/version.c

index 449cf80de3931f57f2b75935271ffa47f50f2fbb..708686b0be87a007a1338c9c0c424eb5abebf609 100644 (file)
@@ -64,7 +64,17 @@ endfunc
 func Test_statusline()
   CheckFeature quickfix
 
-  new Xstatusline
+  " %a: Argument list ({current} of {max})
+  set statusline=%a
+  call assert_match('^\s*$', s:get_statusline())
+  arglocal a1 a2
+  rewind
+  call assert_match('^ (1 of 2)\s*$', s:get_statusline())
+  next
+  call assert_match('^ (2 of 2)\s*$', s:get_statusline())
+  e Xstatusline
+  call assert_match('^ ((2) of 2)\s*$', s:get_statusline())
+
   only
   set laststatus=2
   set splitbelow
index f4afb9a6735213ce2044786b1ba255338d1e8f27..cf2d86803e5c99889e779c6e25b95b12ebfb8e4f 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1043,
 /**/
     1042,
 /**/