Mercurial > vim
comparison src/testdir/test_undo.vim @ 30867:0913cd44fdfa v9.0.0768
patch 9.0.0768: too many delete() calls in tests
Commit: https://github.com/vim/vim/commit/5b148ef2628251b2d79f78c65a614f8aca404329
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 15 21:35:56 2022 +0100
patch 9.0.0768: 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 | Sat, 15 Oct 2022 22:45:02 +0200 |
parents | 008808e60963 |
children | 627d4f236ac8 |
comparison
equal
deleted
inserted
replaced
30866:bd117a061192 | 30867:0913cd44fdfa |
---|---|
382 wundo Xundofile | 382 wundo Xundofile |
383 let contents = readfile('Xundofile', 'B') | 383 let contents = readfile('Xundofile', 'B') |
384 | 384 |
385 " try several sizes | 385 " try several sizes |
386 for size in range(20, 500, 33) | 386 for size in range(20, 500, 33) |
387 call writefile(contents[0:size], 'Xundofile') | 387 call writefile(contents[0:size], 'Xundofile', 'D') |
388 call assert_fails('rundo Xundofile', 'E825:') | 388 call assert_fails('rundo Xundofile', 'E825:') |
389 endfor | 389 endfor |
390 | 390 |
391 bwipe! | 391 bwipe! |
392 call delete('Xundofile') | |
393 endfunc | 392 endfunc |
394 | 393 |
395 func Test_rundo_errors() | 394 func Test_rundo_errors() |
396 call assert_fails('rundo XfileDoesNotExist', 'E822:') | 395 call assert_fails('rundo XfileDoesNotExist', 'E822:') |
397 | 396 |
398 call writefile(['abc'], 'Xundofile') | 397 call writefile(['abc'], 'Xundofile', 'D') |
399 call assert_fails('rundo Xundofile', 'E823:') | 398 call assert_fails('rundo Xundofile', 'E823:') |
400 | |
401 call delete('Xundofile') | |
402 endfunc | 399 endfunc |
403 | 400 |
404 func Test_undofile_next() | 401 func Test_undofile_next() |
405 set undofile | 402 set undofile |
406 new Xfoo.txt | 403 new Xfoo.txt |