From 319298484f212bfd6a673fbbab21c7afcf6259ad Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 10 Dec 2025 23:21:10 +0100 Subject: [PATCH] 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 --- tests/data/test1158 | 3 +-- tests/data/test1186 | 3 +-- tests/getpart.pm | 6 ++++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/data/test1158 b/tests/data/test1158 index a791c6fd4c..befecd763b 100644 --- a/tests/data/test1158 +++ b/tests/data/test1158 @@ -3,7 +3,6 @@ HTTP HTTP FORMPOST -notxml # 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"' # We create this file before the command is invoked! - + foo bar This is a bar foo bar diff --git a/tests/data/test1186 b/tests/data/test1186 index 7a8b69486b..439dbebcf5 100644 --- a/tests/data/test1186 +++ b/tests/data/test1186 @@ -3,7 +3,6 @@ HTTP HTTP FORMPOST -notxml # 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"' # We create this file before the command is invoked! - + foo bar This is a bar foo bar diff --git a/tests/getpart.pm b/tests/getpart.pm index 7fa703d0b1..69b810db5c 100644 --- a/tests/getpart.pm +++ b/tests/getpart.pm @@ -76,9 +76,10 @@ sub testcaseattr { for(@xml) { if(($_ =~ /^ *\]*)/)) { 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; -- 2.47.3