Mercurial > vim
comparison src/testdir/test_indent.vim @ 30580:f08ed0738f7a v9.0.0625
patch 9.0.0625: too many delete() calls in tests
Commit: https://github.com/vim/vim/commit/7dd5a78b88af7734bdbf236fdfafb49f27a0ca2e
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 29 21:01:57 2022 +0100
patch 9.0.0625: 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:15:04 +0200 |
parents | 13b02c1ea0f7 |
children | dbec60b8c253 |
comparison
equal
deleted
inserted
replaced
30579:e298ce7862f7 | 30580:f08ed0738f7a |
---|---|
159 let modeline = &modeline | 159 let modeline = &modeline |
160 set modeline | 160 set modeline |
161 func GetIndent() | 161 func GetIndent() |
162 return line('.') * 2 | 162 return line('.') * 2 |
163 endfunc | 163 endfunc |
164 call writefile(['# vim: indentexpr=GetIndent()'], 'Xmlfile.txt') | 164 call writefile(['# vim: indentexpr=GetIndent()'], 'Xmlfile.txt', 'D') |
165 set modelineexpr | 165 set modelineexpr |
166 new Xmlfile.txt | 166 new Xmlfile.txt |
167 call assert_equal('GetIndent()', &indentexpr) | 167 call assert_equal('GetIndent()', &indentexpr) |
168 exe "normal Oa\nb\n" | 168 exe "normal Oa\nb\n" |
169 call assert_equal([' a', ' b'], getline(1, 2)) | 169 call assert_equal([' a', ' b'], getline(1, 2)) |
170 | 170 |
171 set modelineexpr& | 171 set modelineexpr& |
172 delfunc GetIndent | 172 delfunc GetIndent |
173 let &modeline = modeline | 173 let &modeline = modeline |
174 close! | 174 close! |
175 call delete('Xmlfile.txt') | |
176 endfunc | 175 endfunc |
177 | 176 |
178 func Test_indent_func_with_gq() | 177 func Test_indent_func_with_gq() |
179 | 178 |
180 function GetTeXIndent() | 179 function GetTeXIndent() |