runtests: add support for single-quoted attributes, use it

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
This commit is contained in:
Viktor Szakats 2025-12-10 23:21:10 +01:00
parent 2397be8349
commit 319298484f
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
3 changed files with 6 additions and 6 deletions

View 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

View 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

View 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;