mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
Add support for text mode on stdout tests as well, and add the mode=text
to the docs.
This commit is contained in:
parent
b749910e6c
commit
17ea2631cd
@ -197,11 +197,17 @@ the protocol dump curl should transmit, if 'nonewline' is set, we will cut
|
|||||||
off the trailing newline of this given data before comparing with the one
|
off the trailing newline of this given data before comparing with the one
|
||||||
actually sent by the client
|
actually sent by the client
|
||||||
</protocol>
|
</protocol>
|
||||||
<stdout>
|
<stdout [mode=text]>
|
||||||
This verfies that this data was passed to stdout.
|
This verfies that this data was passed to stdout.
|
||||||
|
|
||||||
|
Use the "mode=text" attribute if the output is in text mode on platforms that
|
||||||
|
have a text/binary difference.
|
||||||
</stdout>
|
</stdout>
|
||||||
<file name="log/filename">
|
<file name="log/filename" [mode=text]>
|
||||||
the file's contents must be identical to this
|
The file's contents must be identical to this after the test is complete.
|
||||||
|
|
||||||
|
Use the "mode=text" attribute if the output is in text mode on platforms that
|
||||||
|
have a text/binary difference.
|
||||||
</file>
|
</file>
|
||||||
<stripfile>
|
<stripfile>
|
||||||
One perl op per line that operates on the file before being compared. This is
|
One perl op per line that operates on the file before being compared. This is
|
||||||
|
@ -33,7 +33,7 @@ HTTP, urlglob retrieval with bad range
|
|||||||
<errorcode>
|
<errorcode>
|
||||||
3
|
3
|
||||||
</errorcode>
|
</errorcode>
|
||||||
<stdout>
|
<stdout mode=text>
|
||||||
curl: (3) [globbing] error: illegal pattern or range specification after pos 24
|
curl: (3) [globbing] error: illegal pattern or range specification after pos 24
|
||||||
|
|
||||||
</stdout>
|
</stdout>
|
||||||
|
@ -1326,6 +1326,16 @@ sub singletest {
|
|||||||
# verify redirected stdout
|
# verify redirected stdout
|
||||||
my @actual = loadarray($STDOUT);
|
my @actual = loadarray($STDOUT);
|
||||||
|
|
||||||
|
# get all attributes
|
||||||
|
my %hash = getpartattr("verify", "stdout");
|
||||||
|
|
||||||
|
# get the mode attribute
|
||||||
|
my $filemode=$hash{'mode'};
|
||||||
|
if(($filemode eq "text") && $has_textaware) {
|
||||||
|
# text mode when running on windows: fix line endings
|
||||||
|
map s/\r\n/\n/g, @actual;
|
||||||
|
}
|
||||||
|
|
||||||
$res = compare("stdout", \@actual, \@validstdout);
|
$res = compare("stdout", \@actual, \@validstdout);
|
||||||
if($res) {
|
if($res) {
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user