]> granicus.if.org Git - vim/commitdiff
patch 8.2.5132: :mkview test doesn't test much v8.2.5132
authorJames McCoy <jamessan@jamessan.com>
Sun, 19 Jun 2022 16:16:18 +0000 (17:16 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 19 Jun 2022 16:16:18 +0000 (17:16 +0100)
Problem:    :mkview test doesn't test much.
Solution:   Save the view with the folds closed. (James McCoy, closes #10596)

src/testdir/test_mksession.vim
src/version.c

index 2e368df8d9cbe3db28432938b62f67d5f7f86ee3..c916b1a517369fea7ed34b1e53df647f1ffa007a 100644 (file)
@@ -583,21 +583,29 @@ func Test_mkview_open_folds()
 
   call append(0, ['a', 'b', 'c'])
   1,3fold
+  write! Xtestfile
+
+  call assert_notequal(-1, foldclosed(1))
+  call assert_notequal(-1, foldclosed(2))
+  call assert_notequal(-1, foldclosed(3))
+
+  " Save the view with folds closed
+  mkview! Xtestview
+
   " zR affects 'foldlevel', make sure the option is applied after the folds
   " have been recreated.
+  " Open folds to ensure they get closed when restoring the view
   normal zR
-  write! Xtestfile
 
   call assert_equal(-1, foldclosed(1))
   call assert_equal(-1, foldclosed(2))
   call assert_equal(-1, foldclosed(3))
 
-  mkview! Xtestview
   source Xtestview
 
-  call assert_equal(-1, foldclosed(1))
-  call assert_equal(-1, foldclosed(2))
-  call assert_equal(-1, foldclosed(3))
+  call assert_notequal(-1, foldclosed(1))
+  call assert_notequal(-1, foldclosed(2))
+  call assert_notequal(-1, foldclosed(3))
 
   call delete('Xtestview')
   call delete('Xtestfile')
index b8bc580ad9e8bb40bd062375989b27114c4f773f..c045d17fb667d96e2445a7d177d91b544d66f074 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    5132,
 /**/
     5131,
 /**/