From 17ea2631cd081dff7380d0b960448d1414f64bd7 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 20 May 2005 10:40:32 +0000 Subject: Add support for text mode on stdout tests as well, and add the mode=text to the docs. --- tests/FILEFORMAT | 12 +++++++++--- tests/data/test75 | 2 +- tests/runtests.pl | 10 ++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/FILEFORMAT b/tests/FILEFORMAT index 616adcda3..57850fb64 100644 --- a/tests/FILEFORMAT +++ b/tests/FILEFORMAT @@ -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 actually sent by the client - + 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. - -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. One perl op per line that operates on the file before being compared. This is diff --git a/tests/data/test75 b/tests/data/test75 index 08cf41ca6..1458cbc1c 100644 --- a/tests/data/test75 +++ b/tests/data/test75 @@ -33,7 +33,7 @@ HTTP, urlglob retrieval with bad range 3 - + curl: (3) [globbing] error: illegal pattern or range specification after pos 24 diff --git a/tests/runtests.pl b/tests/runtests.pl index 0ba5d8bc1..765c38c83 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -1326,6 +1326,16 @@ sub singletest { # verify redirected 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); if($res) { return 1; -- cgit v1.2.3