comparison src/testdir/test_number.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 c99005ffa8c3
children 218363931f5d
comparison
equal deleted inserted replaced
30581:2e1ec75a7766 30582:72245f9c9405
274 call setline(1, range(200)) 274 call setline(1, range(200))
275 111 275 111
276 set number relativenumber 276 set number relativenumber
277 hi LineNr ctermfg=red 277 hi LineNr ctermfg=red
278 [CODE] 278 [CODE]
279 call writefile(lines, 'XTest_relnr') 279 call writefile(lines, 'XTest_relnr', 'D')
280 280
281 " Check that the balloon shows up after a mouse move 281 " Check that the balloon shows up after a mouse move
282 let buf = RunVimInTerminal('-S XTest_relnr', {'rows': 10, 'cols': 50}) 282 let buf = RunVimInTerminal('-S XTest_relnr', {'rows': 10, 'cols': 50})
283 call TermWait(buf, 50) 283 call TermWait(buf, 50)
284 " Default colors 284 " Default colors
293 call term_sendkeys(buf, ":hi clear LineNrAbove\<CR>") 293 call term_sendkeys(buf, ":hi clear LineNrAbove\<CR>")
294 call VerifyScreenDump(buf, 'Test_relnr_colors_4', {}) 294 call VerifyScreenDump(buf, 'Test_relnr_colors_4', {})
295 295
296 " clean up 296 " clean up
297 call StopVimInTerminal(buf) 297 call StopVimInTerminal(buf)
298 call delete('XTest_relnr')
299 endfunc 298 endfunc
300 299
301 func Test_relativenumber_callback() 300 func Test_relativenumber_callback()
302 CheckScreendump 301 CheckScreendump
303 CheckFeature timers 302 CheckFeature timers
311 call cursor(1, 1) 310 call cursor(1, 1)
312 endfunc 311 endfunc
313 312
314 call timer_start(300, 'Func') 313 call timer_start(300, 'Func')
315 END 314 END
316 call writefile(lines, 'Xrnu_timer') 315 call writefile(lines, 'Xrnu_timer', 'D')
317 316
318 let buf = RunVimInTerminal('-S Xrnu_timer', #{rows: 8}) 317 let buf = RunVimInTerminal('-S Xrnu_timer', #{rows: 8})
319 call TermWait(buf, 310) 318 call TermWait(buf, 310)
320 call VerifyScreenDump(buf, 'Test_relativenumber_callback_1', {}) 319 call VerifyScreenDump(buf, 'Test_relativenumber_callback_1', {})
321 320
322 call StopVimInTerminal(buf) 321 call StopVimInTerminal(buf)
323 call delete('Xrnu_timer')
324 endfunc 322 endfunc
325 323
326 " Test for displaying line numbers with 'rightleft' 324 " Test for displaying line numbers with 'rightleft'
327 func Test_number_rightleft() 325 func Test_number_rightleft()
328 CheckFeature rightleft 326 CheckFeature rightleft