]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test1165: improve pattern matching
authorEvgeny Grin <k2k@narod.ru>
Thu, 8 Feb 2024 17:41:55 +0000 (18:41 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 9 Feb 2024 22:57:09 +0000 (23:57 +0100)
* Fix excluded digits at the end of the symbols ('CURL_DISABLE_POP3'
  was checked as 'CURL_DISABLE_POP')

Closes #12903

tests/test1165.pl

index b6f3179cf751b87d9b05a8f9eed9e9aa232f0c0c..bccbef9366c124d9bff7445e5fa02c07723787c4 100755 (executable)
@@ -44,7 +44,7 @@ sub scanconf {
     my ($f)=@_;
     open S, "<$f";
     while(<S>) {
-        if(/(CURL_DISABLE_[A-Z_]+)/g) {
+        if(/(CURL_DISABLE_[A-Z0-9_]+)/g) {
             my ($sym)=($1);
             $disable{$sym} = 1;
         }
@@ -67,9 +67,9 @@ sub scanconf_cmake {
     my ($f)=@_;
     open S, "<$f";
     while(<S>) {
-        if(/(CURL_DISABLE_[A-Z_]+)/g) {
+        if(/(CURL_DISABLE_[A-Z0-9_]+)/g) {
             my ($sym)=($1);
-            if(not $sym =~ /(CURL_DISABLE_INSTALL|CURL_DISABLE_TESTS|CURL_DISABLE_SRP)/) {
+            if(not $sym =~ /^(CURL_DISABLE_INSTALL|CURL_DISABLE_TESTS|CURL_DISABLE_SRP)$/) {
                 $disable_cmake{$sym} = 1;
             }
         }
@@ -85,7 +85,7 @@ sub scan_file {
     my ($source)=@_;
     open F, "<$source";
     while(<F>) {
-        while(s/(CURL_DISABLE_[A-Z_]+)//) {
+        while(s/(CURL_DISABLE_[A-Z0-9_]+)//) {
             my ($sym)=($1);
             $file{$sym} = $source;
         }
@@ -115,7 +115,7 @@ sub scan_docs {
     my $line = 0;
     while(<F>) {
         $line++;
-        if(/^## `(CURL_DISABLE_[A-Z_]+)/g) {
+        if(/^## `(CURL_DISABLE_[A-Z0-9_]+)`/g) {
             my ($sym)=($1);
             $docs{$sym} = $line;
         }