]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
spacecheck.pl: verify `tests/data/test*` for non-ASCII chars
authorViktor Szakats <commit@vsz.me>
Mon, 12 May 2025 17:20:40 +0000 (19:20 +0200)
committerViktor Szakats <commit@vsz.me>
Tue, 13 May 2025 06:47:47 +0000 (08:47 +0200)
Exclude test data files (4 of them) based on existing feature tags:
`codeset-utf8` and `Unicode`.

Add the new keyword `non-ascii` to mark remaining exceptions (9 files).

Follow-up to 838dc53bb7bf52039b23af0e9ccffa51cf9ad7d0 #17247

Closes #17329

12 files changed:
.github/scripts/spacecheck.pl
tests/FILEFORMAT.md
tests/data/test1138
tests/data/test1160
tests/data/test1631
tests/data/test1632
tests/data/test31
tests/data/test469
tests/data/test470
tests/data/test497
tests/data/test498
tests/data/test649

index e8b64f2dc7eae2193ddb4343e2c6ae6cc955e287..b47dbc6a8c6ef215f477c389e285f885c74e6ada 100755 (executable)
@@ -69,7 +69,6 @@ my @non_ascii = (
     "docs/THANKS",
     "docs/THANKS-filter",
     "tests/libtest/lib1560.c",
-    "^tests/data/test",
 );
 
 sub fn_match {
@@ -162,7 +161,7 @@ while(my $filename = <$git_ls_files>) {
     $content =~ s/[$non_ascii_allowed]//g;
 
     if(!fn_match($filename, @non_ascii) &&
-       $content =~ /([\x80-\xff]+)/) {
+       ($content =~ /([\x80-\xff]+)/ && $content !~ /^(codeset-utf8|Unicode|non-ascii)/m)) {
         push @err, "content: has non-ASCII: '$1'";
     }
 
index 436c4ce29b378097c04da7e196dd57def8d435f3..263ce7f067bf63c4b7e799d9e409755078f1f1ef 100644 (file)
@@ -226,6 +226,10 @@ Tests that have strict timing dependencies have the `timing-dependent` keyword.
 These are intended to eventually be treated specially on CI builds which are
 often run on overloaded machines with unpredictable timing.
 
+Tests using non-7-bit-ASCII characters, and not using features `Unicode` or
+`codeset-utf8`, need to add the `non-ascii` keyword to tell the code checker
+to allow these characters.
+
 ## `<reply>`
 
 ### `<data [nocheck="yes"] [sendzero="yes"] [hex="yes"] [nonewline="yes"] [crlf="yes"]>`
index 9afe8d7fbd4bb994472be694be58d7803758f49b..74648184962a9b2dc1c015cd093f25df02aa0512 100644 (file)
@@ -4,6 +4,7 @@
 HTTP
 HTTP GET
 followlocation
+non-ascii
 </keywords>
 </info>
 #
index 0e946b34bf46e06f70ad17385b85dfdfe8236689..77ea92a042a07056a51fbd8831f01054e74480f5 100644 (file)
@@ -5,6 +5,7 @@
 HTTP
 HTTP GET
 cookies
+non-ascii
 </keywords>
 </info>
 
index 16786b879af30dbaee3db1dd6ea2f3f1efac5a7a..db7d3912332f21dbd0f963a1c871140624ef8f81 100644 (file)
@@ -4,6 +4,7 @@
 FTP
 HTTPS proxy
 flaky
+non-ascii
 </keywords>
 </info>
 
index 1494eb40acfca03f27875e777dec56e6d1b683a4..c72296bd2f36c632ed28452fa51ea6b790b18a45 100644 (file)
@@ -4,6 +4,7 @@
 FTP
 HTTPS proxy
 flaky
+non-ascii
 </keywords>
 </info>
 
index bdc0a8d1d526070c840fb6f6239452985ad8a2f4..0392207f65a127be6e7eca7cf2f24c6aa5b13474 100644 (file)
@@ -5,6 +5,7 @@ HTTP
 HTTP GET
 cookies
 cookiejar
+non-ascii
 </keywords>
 </info>
 # Server-side
index b6f0bdbdea7c7fc26ec58d4405ecf8d67bf54730..ace2694933d573d9a22cf54e86a2995f8f0caf31 100644 (file)
@@ -2,6 +2,7 @@
 <info>
 <keywords>
 HTTP
+non-ascii
 </keywords>
 </info>
 
index 7b2da01e830f9128d8364a234b38fc06da96f67e..f99d461b773c1ee2e18d619bb7129e026be95767 100644 (file)
@@ -2,6 +2,7 @@
 <info>
 <keywords>
 HTTP
+non-ascii
 </keywords>
 </info>
 
index 3966ab225629c4f112f7fc1abdd3a457669a5902..300201b1fc7149b4cec08fa30dd947f5636c5f10 100644 (file)
@@ -3,6 +3,7 @@
 <keywords>
 HTTP
 HTTP GET
+non-ascii
 </keywords>
 </info>
 
index 6c9f8d239e0ba7371a2713b49451e59db2dde34d..4426f7a29ca6aa95c54f177e6664779b8ead690b 100644 (file)
@@ -3,6 +3,7 @@
 <keywords>
 HTTP
 HTTP GET
+non-ascii
 </keywords>
 </info>
 
index 502e16ea5698d680951de2c46c79961e4e2dfec4..25128aee67f9dab5f0e23957b8735e390aa0619e 100644 (file)
@@ -3,6 +3,7 @@
 <keywords>
 SMTP
 MULTIPART
+non-ascii
 </keywords>
 </info>