]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.2009: tests: "Xm4" test directory may not be deleted v9.1.2009
authorMuraoka Taro <koron.kaoriya@gmail.com>
Mon, 22 Dec 2025 18:33:50 +0000 (18:33 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 22 Dec 2025 18:33:50 +0000 (18:33 +0000)
Problem:  tests: "Xm4" test directory may not be deleted
Solution: Use "R" flag with mkdir() call to have the directory
          recursively deleted at the end of function Test_m4_format()
          (Muraoka Taro)

Test_m4_format in test_filetype.vim creates the "Xm4" directory with the
'D' flag. Then it creates two files in the "Xm4" directory. One of them,
"alocal.m4," was created with the 'D' flag, so it will disappear after
the test is complete. However, the other, "configure.ac," was created
without any flags, so it will remain even after the test is complete.
Because the parent directory "Xm4" was created with the 'D' flag, the
latter "configure.ac" remains and is not empty, so it will not be
deleted.

This forces the directory to be deleted regardless of its contents. As a
result, the two files "alocal.m4" and "configure.ac" created in the
directory are no longer needed, so they have been deleted.

closes: #18995

Signed-off-by: Muraoka Taro <koron.kaoriya@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/test_filetype.vim
src/version.c

index 03682688c03bf59b2401b213ee95cac7b30d707a..ee6f6c9ec16944976cd7db1aacb0efc861c89bcb 100644 (file)
@@ -3235,9 +3235,9 @@ endfunc
 func Test_m4_format()
   filetype on
 
-  call mkdir('Xm4', 'D')
+  call mkdir('Xm4', 'R')
   cd Xm4
-  call writefile([''], 'alocal.m4', 'D')
+  call writefile([''], 'alocal.m4')
   split alocal.m4
   call assert_equal('m4', &filetype)
   bwipe!
index 39b4a15ad1aa31f01102e2f46dfbce059482e9e1..28336399bcb567789eb1ea19e5a21a1f88d3a182 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2009,
 /**/
     2008,
 /**/