From: Viktor Szakats Date: Mon, 12 May 2025 17:20:40 +0000 (+0200) Subject: spacecheck.pl: verify `tests/data/test*` for non-ASCII chars X-Git-Tag: curl-8_14_0~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9243ed59b387a90940fa4a16ebfd99ad7d6c2f63;p=thirdparty%2Fcurl.git spacecheck.pl: verify `tests/data/test*` for non-ASCII chars 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 --- diff --git a/.github/scripts/spacecheck.pl b/.github/scripts/spacecheck.pl index e8b64f2dc7..b47dbc6a8c 100755 --- a/.github/scripts/spacecheck.pl +++ b/.github/scripts/spacecheck.pl @@ -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'"; } diff --git a/tests/FILEFORMAT.md b/tests/FILEFORMAT.md index 436c4ce29b..263ce7f067 100644 --- a/tests/FILEFORMAT.md +++ b/tests/FILEFORMAT.md @@ -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. + ## `` ### `` diff --git a/tests/data/test1138 b/tests/data/test1138 index 9afe8d7fbd..7464818496 100644 --- a/tests/data/test1138 +++ b/tests/data/test1138 @@ -4,6 +4,7 @@ HTTP HTTP GET followlocation +non-ascii # diff --git a/tests/data/test1160 b/tests/data/test1160 index 0e946b34bf..77ea92a042 100644 --- a/tests/data/test1160 +++ b/tests/data/test1160 @@ -5,6 +5,7 @@ HTTP HTTP GET cookies +non-ascii diff --git a/tests/data/test1631 b/tests/data/test1631 index 16786b879a..db7d391233 100644 --- a/tests/data/test1631 +++ b/tests/data/test1631 @@ -4,6 +4,7 @@ FTP HTTPS proxy flaky +non-ascii diff --git a/tests/data/test1632 b/tests/data/test1632 index 1494eb40ac..c72296bd2f 100644 --- a/tests/data/test1632 +++ b/tests/data/test1632 @@ -4,6 +4,7 @@ FTP HTTPS proxy flaky +non-ascii diff --git a/tests/data/test31 b/tests/data/test31 index bdc0a8d1d5..0392207f65 100644 --- a/tests/data/test31 +++ b/tests/data/test31 @@ -5,6 +5,7 @@ HTTP HTTP GET cookies cookiejar +non-ascii # Server-side diff --git a/tests/data/test469 b/tests/data/test469 index b6f0bdbdea..ace2694933 100644 --- a/tests/data/test469 +++ b/tests/data/test469 @@ -2,6 +2,7 @@ HTTP +non-ascii diff --git a/tests/data/test470 b/tests/data/test470 index 7b2da01e83..f99d461b77 100644 --- a/tests/data/test470 +++ b/tests/data/test470 @@ -2,6 +2,7 @@ HTTP +non-ascii diff --git a/tests/data/test497 b/tests/data/test497 index 3966ab2256..300201b1fc 100644 --- a/tests/data/test497 +++ b/tests/data/test497 @@ -3,6 +3,7 @@ HTTP HTTP GET +non-ascii diff --git a/tests/data/test498 b/tests/data/test498 index 6c9f8d239e..4426f7a29c 100644 --- a/tests/data/test498 +++ b/tests/data/test498 @@ -3,6 +3,7 @@ HTTP HTTP GET +non-ascii diff --git a/tests/data/test649 b/tests/data/test649 index 502e16ea56..25128aee67 100644 --- a/tests/data/test649 +++ b/tests/data/test649 @@ -3,6 +3,7 @@ SMTP MULTIPART +non-ascii