runtime(syntax-tests): Apply "word" rather than "prefix" when filtering filetypes
Commit:
https://github.com/vim/vim/commit/b6419b6fa5e3bd5ab84a4d25b01b9ea8a73aaa6a
Author: Aliaksei Budavei <
0x00...@gmail.com>
Date: Thu Sep 24 18:55:50 2026 +0000
runtime(syntax-tests): Apply "word" rather than "prefix" when filtering filetypes
Whenever two or more filetype names share a common prefix,
e.g. "java" and "javascript", passing the shortest name
argument to Make, e.g. "make java test", will trigger the
running of _all prefix matching_ test suites. To fix this
blunder and to only have _requested_ test suites run, always
append the leftmost conventional delimiters "[._]", e.g.
"java[.]java", "java[_]numbers.java", to each filetype name
when automatically assembling a regexp pattern for the
filename filter. Furthermore, promote the Vim9 (pseudo-)
filetype, e.g. "make vim9 test", "make vim vim9 test", etc.
As before, VIM_SYNTAX_TEST_FILTER is still within reach for
arbitrary test case grouping.
closes: #21351
Signed-off-by: Aliaksei Budavei <
0x00...@gmail.com>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/runtime/syntax/Makefile b/runtime/syntax/Makefile
index d0f71270a..18e9b92fe 100644
--- a/runtime/syntax/Makefile
+++ b/runtime/syntax/Makefile
@@ -68,7 +68,6 @@ awk 'BEGIN { \
types[parts[1]]; \
print names[3]; \
} \
- delete types["vim9"]; \
split("$(phonies)", scratch); \
for (phony in scratch) \
phonies[scratch[phony]]; \
diff --git a/runtime/syntax/testdir/runtest.vim b/runtime/syntax/testdir/runtest.vim
index 86fbf0e06..b8c9df188 100644
--- a/runtime/syntax/testdir/runtest.vim
+++ b/runtime/syntax/testdir/runtest.vim
@@ -458,13 +458,14 @@ func RunTest()
" Turn a subset of filenames etc. requested for testing into a pattern.
if filereadable('../testdir/Xfilter')
let filter = readfile('../testdir/Xfilter')
- \ ->map({_, v -> '^' .. escape(substitute(v, '_$', '', ''), '.')})
+ \ ->map({_, v -> '^' .. escape(substitute(v, '_$', '', ''), '.')
+ \ .. (v !~ '.\..' ? '[._]' : '$')})
\ ->join('\|')
call delete('../testdir/Xfilter')
endif
- " Treat "^self-testing" as a string NOT as a regexp.
- if filter ==# '^self-testing'
+ " Treat "^self-testing[._]" as a string NOT as a regexp.
+ if filter ==# '^self-testing[._]'
let dirpath = 'input/selftestdir/'
let fnames = readdir(dirpath, {fname -> fname !~ '^README\.txt$'})
else
diff --git a/runtime/syntax/testdir/tools/maketestdeps b/runtime/syntax/testdir/tools/maketestdeps
index 61bf061f7..f621a4e60 100755
--- a/runtime/syntax/testdir/tools/maketestdeps
+++ b/runtime/syntax/testdir/tools/maketestdeps
@@ -17,7 +17,6 @@ for input in testdir/input/*.*; do
basename=$(basename "$input")
case "$basename" in
- vim9_*.*) ft=vim;;
*_*.*) ft=${basename%%_*};;
*.*) ft=${basename%%.*};;
*) exit 1
@@ -29,7 +28,7 @@ for input in testdir/input/*.*; do
fi
cat << EOF
-$input: $ft.vim $vimsetup
+$input: ${ft/#vim9/vim}.vim $vimsetup
touch -c \$@
$basename:: $input
$ft:: $basename