comparison src/testdir/test_mksession.vim @ 30582:72245f9c9405 v9.0.0626

patch 9.0.0626: too many delete() calls in tests Commit: https://github.com/vim/vim/commit/b152b6a40f729ed81a25d2fa541a4e73e201bec4 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 29 21:37:33 2022 +0100 patch 9.0.0626: too many delete() calls in tests Problem: Too many delete() calls in tests. Solution: Use deferred delete where possible.
author Bram Moolenaar <Bram@vim.org>
date Thu, 29 Sep 2022 22:45:04 +0200
parents 13b02c1ea0f7
children 852040d9b096
comparison
equal deleted inserted replaced
30581:2e1ec75a7766 30582:72245f9c9405
1096 set sessionoptions-=options 1096 set sessionoptions-=options
1097 mksession Xtestsession 1097 mksession Xtestsession
1098 bwipe! 1098 bwipe!
1099 1099
1100 " Recreate the swap file to pretend the file is being edited 1100 " Recreate the swap file to pretend the file is being edited
1101 call writefile(cont, fname) 1101 call writefile(cont, fname, 'D')
1102 set shortmess+=A 1102 set shortmess+=A
1103 source Xtestsession 1103 source Xtestsession
1104 1104
1105 set shortmess& 1105 set shortmess&
1106 set sessionoptions& 1106 set sessionoptions&
1107 call delete('Xtestsession') 1107 call delete('Xtestsession')
1108 call delete(fname)
1109 endfunc 1108 endfunc
1110 1109
1111 " Test for mksession with 'compatible' option 1110 " Test for mksession with 'compatible' option
1112 func Test_mksession_compatible() 1111 func Test_mksession_compatible()
1113 mksession! Xtest_mks1.out 1112 mksession! Xtest_mks1.out
1233 call delete('Xtest_altfile') 1232 call delete('Xtest_altfile')
1234 endfunc 1233 endfunc
1235 1234
1236 " Test for creating views with manual folds 1235 " Test for creating views with manual folds
1237 func Test_mkview_manual_fold() 1236 func Test_mkview_manual_fold()
1238 call writefile(range(1,10), 'Xmkvfile') 1237 call writefile(range(1,10), 'Xmkvfile', 'D')
1239 new Xmkvfile 1238 new Xmkvfile
1240 " create recursive folds 1239 " create recursive folds
1241 5,6fold 1240 5,6fold
1242 4,7fold 1241 4,7fold
1243 mkview Xview 1242 mkview Xview
1257 mkview! Xview 1256 mkview! Xview
1258 normal zE 1257 normal zE
1259 source Xview 1258 source Xview
1260 call assert_equal([-1, -1, -1, -1, -1, -1], [foldclosed(3), foldclosed(4), 1259 call assert_equal([-1, -1, -1, -1, -1, -1], [foldclosed(3), foldclosed(4),
1261 \ foldclosed(5), foldclosed(6), foldclosed(7), foldclosed(8)]) 1260 \ foldclosed(5), foldclosed(6), foldclosed(7), foldclosed(8)])
1262 call delete('Xmkvfile')
1263 call delete('Xview') 1261 call delete('Xview')
1264 bw! 1262 bw!
1265 endfunc 1263 endfunc
1266 1264
1267 " vim: shiftwidth=2 sts=2 expandtab 1265 " vim: shiftwidth=2 sts=2 expandtab