tests: replace significant invisible spaces with macros

To make them explicit, visible, avoid being accidentally trimmed.
Also prevents Git warnings, e.g. on `git am`.

Also:
- runtests: add support for `%spc%` and `%tab%` macros.
- test59: delete non-significant line-ending space.
- spacecheck.pl: drop line-ending whitespace exception for tests.

Closes #19300
This commit is contained in:
Viktor Szakats 2025-10-31 00:55:13 +01:00
parent 928363f28c
commit d29f14b9cf
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
41 changed files with 64 additions and 58 deletions

View file

@ -42,10 +42,6 @@ my @need_crlf = (
"\\.(bat|sln)\$",
);
my @space_at_eol = (
"^tests/data/test",
);
my @non_ascii_allowed = (
'\xC3\xB6', # UTF-8 for https://codepoints.net/U+00F6 LATIN SMALL LETTER O WITH DIAERESIS
);
@ -129,8 +125,7 @@ while(my $filename = <$git_ls_files>) {
push @err, "content: must use LF EOL for this file type";
}
if(!fn_match($filename, @space_at_eol) &&
$content =~ /[ \t]\n/) {
if($content =~ /[ \t]\n/) {
my $line;
for my $l (split(/\n/, $content)) {
$line++;