diff src/testdir/test_help.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 af4ffc4b2a26
children bcd204e28fed
line wrap: on
line diff
--- a/src/testdir/test_help.vim
+++ b/src/testdir/test_help.vim
@@ -129,30 +129,30 @@ endfunc
 " Test for the :helptags command
 " NOTE: if you run tests as root this will fail.  Don't run tests as root!
 func Test_helptag_cmd()
-  call mkdir('Xdir/a/doc', 'p')
+  call mkdir('Xtagdir/a/doc', 'p')
 
   " No help file to process in the directory
-  call assert_fails('helptags Xdir', 'E151:')
+  call assert_fails('helptags Xtagdir', 'E151:')
 
-  call writefile([], 'Xdir/a/doc/sample.txt')
+  call writefile([], 'Xtagdir/a/doc/sample.txt')
 
   " Test for ++t argument
-  helptags ++t Xdir
-  call assert_equal(["help-tags\ttags\t1"], readfile('Xdir/tags'))
-  call delete('Xdir/tags')
+  helptags ++t Xtagdir
+  call assert_equal(["help-tags\ttags\t1"], readfile('Xtagdir/tags'))
+  call delete('Xtagdir/tags')
 
   " Test parsing tags
   call writefile(['*tag1*', 'Example: >', '  *notag*', 'Example end: *tag2*'],
-    \ 'Xdir/a/doc/sample.txt')
-  helptags Xdir
+    \ 'Xtagdir/a/doc/sample.txt')
+  helptags Xtagdir
   call assert_equal(["tag1\ta/doc/sample.txt\t/*tag1*",
-                  \  "tag2\ta/doc/sample.txt\t/*tag2*"], readfile('Xdir/tags'))
+                  \  "tag2\ta/doc/sample.txt\t/*tag2*"], readfile('Xtagdir/tags'))
 
   " Duplicate tags in the help file
-  call writefile(['*tag1*', '*tag1*', '*tag2*'], 'Xdir/a/doc/sample.txt')
-  call assert_fails('helptags Xdir', 'E154:')
+  call writefile(['*tag1*', '*tag1*', '*tag2*'], 'Xtagdir/a/doc/sample.txt')
+  call assert_fails('helptags Xtagdir', 'E154:')
 
-  call delete('Xdir', 'rf')
+  call delete('Xtagdir', 'rf')
 endfunc
 
 func Test_helptag_cmd_readonly()
@@ -160,25 +160,25 @@ func Test_helptag_cmd_readonly()
   CheckNotRoot
 
   " Read-only tags file
-  call mkdir('Xdir/doc', 'p')
-  call writefile([''], 'Xdir/doc/tags')
-  call writefile([], 'Xdir/doc/sample.txt')
-  call setfperm('Xdir/doc/tags', 'r-xr--r--')
-  call assert_fails('helptags Xdir/doc', 'E152:', getfperm('Xdir/doc/tags'))
+  call mkdir('Xrodir/doc', 'p')
+  call writefile([''], 'Xrodir/doc/tags')
+  call writefile([], 'Xrodir/doc/sample.txt')
+  call setfperm('Xrodir/doc/tags', 'r-xr--r--')
+  call assert_fails('helptags Xrodir/doc', 'E152:', getfperm('Xrodir/doc/tags'))
 
   let rtp = &rtp
-  let &rtp = 'Xdir'
+  let &rtp = 'Xrodir'
   helptags ALL
   let &rtp = rtp
 
-  call delete('Xdir/doc/tags')
+  call delete('Xrodir/doc/tags')
 
   " No permission to read the help file
-  call mkdir('Xdir/b/doc', 'p')
-  call writefile([], 'Xdir/b/doc/sample.txt')
-  call setfperm('Xdir/b/doc/sample.txt', '-w-------')
-  call assert_fails('helptags Xdir', 'E153:', getfperm('Xdir/b/doc/sample.txt'))
-  call delete('Xdir', 'rf')
+  call mkdir('Xrodir/b/doc', 'p')
+  call writefile([], 'Xrodir/b/doc/sample.txt')
+  call setfperm('Xrodir/b/doc/sample.txt', '-w-------')
+  call assert_fails('helptags Xrodir', 'E153:', getfperm('Xrodir/b/doc/sample.txt'))
+  call delete('Xrodir', 'rf')
 endfunc
 
 " Test for setting the 'helpheight' option in the help window