mirror of
https://github.com/curl/curl.git
synced 2026-08-26 01:03:32 +03:00
runtests.pl: check up to 5 data parts with different text modes
Move the text-mode conversion for reply/replycheck from the verify section into the load section and add support for 4 more check parts.
This commit is contained in:
parent
90c2d215d7
commit
a9ebd1bddc
1 changed files with 35 additions and 11 deletions
|
|
@ -3284,18 +3284,50 @@ sub singletest {
|
||||||
|
|
||||||
if (@replycheck) {
|
if (@replycheck) {
|
||||||
# we use this file instead to check the final output against
|
# we use this file instead to check the final output against
|
||||||
|
# get the mode attribute
|
||||||
|
my $filemode=$replycheckattr{'mode'};
|
||||||
|
if($filemode && ($filemode eq "text") && $has_textaware) {
|
||||||
|
# text mode when running on windows: fix line endings
|
||||||
|
map s/\r\n/\n/g, @replycheck;
|
||||||
|
map s/\n/\r\n/g, @replycheck;
|
||||||
|
}
|
||||||
if($replycheckattr{'nonewline'}) {
|
if($replycheckattr{'nonewline'}) {
|
||||||
# Yes, we must cut off the final newline from the final line
|
# Yes, we must cut off the final newline from the final line
|
||||||
# of the datacheck
|
# of the datacheck
|
||||||
chomp($replycheck[$#replycheck]);
|
chomp($replycheck[$#replycheck]);
|
||||||
}
|
}
|
||||||
if($replycheckattr{'mode'}) {
|
|
||||||
$replyattr{'mode'} = $replycheckattr{'mode'};
|
for my $partsuffix (('1', '2', '3', '4')) {
|
||||||
|
my @replycheckpart = getpart("reply", "datacheck".$partsuffix);
|
||||||
|
if(@replycheckpart || partexists("reply", "datacheck".$partsuffix) ) {
|
||||||
|
my %replycheckpartattr = getpartattr("reply", "datacheck".$partsuffix);
|
||||||
|
# get the mode attribute
|
||||||
|
my $filemode=$replycheckpartattr{'mode'};
|
||||||
|
if($filemode && ($filemode eq "text") && $has_textaware) {
|
||||||
|
# text mode when running on windows: fix line endings
|
||||||
|
map s/\r\n/\n/g, @replycheckpart;
|
||||||
|
map s/\n/\r\n/g, @replycheckpart;
|
||||||
|
}
|
||||||
|
if($replycheckpartattr{'nonewline'}) {
|
||||||
|
# Yes, we must cut off the final newline from the final line
|
||||||
|
# of the datacheck
|
||||||
|
chomp($replycheckpart[$#replycheckpart]);
|
||||||
|
}
|
||||||
|
push(@replycheck, @replycheckpart);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@reply=@replycheck;
|
@reply=@replycheck;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
# get the mode attribute
|
||||||
|
my $filemode=$replyattr{'mode'};
|
||||||
|
if($filemode && ($filemode eq "text") && $has_textaware) {
|
||||||
|
# text mode when running on windows: fix line endings
|
||||||
|
map s/\r\n/\n/g, @reply;
|
||||||
|
map s/\n/\r\n/g, @reply;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# this is the valid protocol blurb curl should generate
|
# this is the valid protocol blurb curl should generate
|
||||||
my @protocol= fixarray ( getpart("verify", "protocol") );
|
my @protocol= fixarray ( getpart("verify", "protocol") );
|
||||||
|
|
@ -3831,14 +3863,6 @@ sub singletest {
|
||||||
if(!$replyattr{'nocheck'} && (@reply || $replyattr{'sendzero'})) {
|
if(!$replyattr{'nocheck'} && (@reply || $replyattr{'sendzero'})) {
|
||||||
# verify the received data
|
# verify the received data
|
||||||
my @out = loadarray($CURLOUT);
|
my @out = loadarray($CURLOUT);
|
||||||
# get the mode attribute
|
|
||||||
my $filemode=$replyattr{'mode'};
|
|
||||||
if($filemode && ($filemode eq "text") && $has_textaware) {
|
|
||||||
# text mode when running on windows: fix line endings
|
|
||||||
map s/\r\n/\n/g, @reply;
|
|
||||||
map s/\n/\r\n/g, @reply;
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = compare($testnum, $testname, "data", \@out, \@reply);
|
$res = compare($testnum, $testname, "data", \@out, \@reply);
|
||||||
if ($res) {
|
if ($res) {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue