Mercurial > vim
comparison src/testdir/test_writefile.vim @ 29970:d891115c0aea v9.0.0323
patch 9.0.0323: using common name in tests leads to flaky tests
Commit: https://github.com/vim/vim/commit/3b0d70f4ff436cb144683dafd956e8a3ee485a90
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Aug 29 22:31:20 2022 +0100
patch 9.0.0323: using common name in tests leads to flaky tests
Problem: Using common name in tests leads to flaky tests.
Solution: Rename files and directories to be more specific.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 29 Aug 2022 23:45:04 +0200 |
parents | b737bfa876c5 |
children | 13b02c1ea0f7 |
comparison
equal
deleted
inserted
replaced
29969:5f2d38cacd6c | 29970:d891115c0aea |
---|---|
249 | 249 |
250 call assert_fails('w > Xtest', 'E494:') | 250 call assert_fails('w > Xtest', 'E494:') |
251 | 251 |
252 " Try to overwrite a directory | 252 " Try to overwrite a directory |
253 if has('unix') | 253 if has('unix') |
254 call mkdir('Xdir1') | 254 call mkdir('Xwerdir1') |
255 call assert_fails('write Xdir1', 'E17:') | 255 call assert_fails('write Xwerdir1', 'E17:') |
256 call delete('Xdir1', 'd') | 256 call delete('Xwerdir1', 'd') |
257 endif | 257 endif |
258 | 258 |
259 " Test for :wall for a buffer with no name | 259 " Test for :wall for a buffer with no name |
260 enew | only | 260 enew | only |
261 call setline(1, ['L1']) | 261 call setline(1, ['L1']) |
477 " On MS-Windows, modifying files in a read-only directory is allowed. | 477 " On MS-Windows, modifying files in a read-only directory is allowed. |
478 CheckUnix | 478 CheckUnix |
479 " Root can do it too. | 479 " Root can do it too. |
480 CheckNotRoot | 480 CheckNotRoot |
481 | 481 |
482 call mkdir('Xdir/') | 482 call mkdir('Xrodir/') |
483 call writefile(['one'], 'Xdir/Xfile1') | 483 call writefile(['one'], 'Xrodir/Xfile1') |
484 call setfperm('Xdir', 'r-xr--r--') | 484 call setfperm('Xrodir', 'r-xr--r--') |
485 " try to create a new file in the directory | 485 " try to create a new file in the directory |
486 new Xdir/Xfile2 | 486 new Xrodir/Xfile2 |
487 call setline(1, 'two') | 487 call setline(1, 'two') |
488 call assert_fails('write', 'E212:') | 488 call assert_fails('write', 'E212:') |
489 " try to create a backup file in the directory | 489 " try to create a backup file in the directory |
490 edit! Xdir/Xfile1 | 490 edit! Xrodir/Xfile1 |
491 set backupdir=./Xdir backupskip= | 491 set backupdir=./Xrodir backupskip= |
492 set patchmode=.orig | 492 set patchmode=.orig |
493 call assert_fails('write', 'E509:') | 493 call assert_fails('write', 'E509:') |
494 call setfperm('Xdir', 'rwxr--r--') | 494 call setfperm('Xrodir', 'rwxr--r--') |
495 call delete('Xdir', 'rf') | 495 call delete('Xrodir', 'rf') |
496 set backupdir& backupskip& patchmode& | 496 set backupdir& backupskip& patchmode& |
497 endfunc | 497 endfunc |
498 | 498 |
499 " Test for writing a file using invalid file encoding | 499 " Test for writing a file using invalid file encoding |
500 func Test_write_invalid_encoding() | 500 func Test_write_invalid_encoding() |