]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: add support for single-quoted attributes, use it
authorViktor Szakats <commit@vsz.me>
Wed, 10 Dec 2025 22:21:10 +0000 (23:21 +0100)
committerViktor Szakats <commit@vsz.me>
Wed, 10 Dec 2025 23:08:16 +0000 (00:08 +0100)
With this, all test data files are XML-compliant.

Also:
- test1158, test1186: use single quotes for the test filename attribute
  containing a double quote. For XML-compliance.
- drop support for unquoted attributes. For XML-compliance.

Closes #19926

tests/data/test1158
tests/data/test1186
tests/getpart.pm

index a791c6fd4ccf39462800c9312d31f36e983f86bc..befecd763bdb27ca6a15255ebe78afc24424ca3c 100644 (file)
@@ -3,7 +3,6 @@
 <keywords>
 HTTP
 HTTP FORMPOST
-notxml
 </keywords>
 </info>
 # Server-side
@@ -37,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER
 -F 'file3=@"%LOGDIR/test%TESTNUMBER\".txt";type=m/f,"%LOGDIR/test%TESTNUMBER\".txt"'
 </command>
 # We create this file before the command is invoked!
-<file name=%LOGDIR/test%TESTNUMBER".txt>
+<file name='%LOGDIR/test%TESTNUMBER".txt'>
 foo bar
 This is a bar foo
 bar
index 7a8b69486b7dd022b51b85e4b87682b8143da029..439dbebcf54e63b14c293f044c1cf8aba912ed70 100644 (file)
@@ -3,7 +3,6 @@
 <keywords>
 HTTP
 HTTP FORMPOST
-notxml
 </keywords>
 </info>
 # Server-side
@@ -37,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --form-escape
 -F 'file3=@"%LOGDIR/test%TESTNUMBER\".txt";type=m/f,"%LOGDIR/test%TESTNUMBER\".txt"'
 </command>
 # We create this file before the command is invoked!
-<file name=%LOGDIR/test%TESTNUMBER".txt>
+<file name='%LOGDIR/test%TESTNUMBER".txt'>
 foo bar
 This is a bar foo
 bar
index 7fa703d0b1784efa641d139da65d7632c0860987..69b810db5c47a9d19a396804ba9e3d4ec806a186 100644 (file)
@@ -76,9 +76,10 @@ sub testcaseattr {
     for(@xml) {
         if(($_ =~ /^ *\<testcase ([^>]*)/)) {
             my $attr=$1;
-            while($attr =~ s/ *([^=]*)= *(\"([^\"]*)\"|([^\> ]*))//) {
+            while($attr =~ s/ *([^=]*)= *(\"([^\"]*)\"|\'([^\']*)\')//) {
                 my ($var, $cont)=($1, $2);
                 $cont =~ s/^\"(.*)\"$/$1/;
+                $cont =~ s/^\'(.*)\'$/$1/;
                 $hash{$var}=$cont;
             }
         }
@@ -108,9 +109,10 @@ sub getpartattr {
             $inside++;
             my $attr=$1;
 
-            while($attr =~ s/ *([^=]*)= *(\"([^\"]*)\"|([^\> ]*))//) {
+            while($attr =~ s/ *([^=]*)= *(\"([^\"]*)\"|\'([^\']*)\')//) {
                 my ($var, $cont)=($1, $2);
                 $cont =~ s/^\"(.*)\"$/$1/;
+                $cont =~ s/^\'(.*)\'$/$1/;
                 $hash{$var}=$cont;
             }
             last;