]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Add support for text mode on stdout tests as well, and add the mode=text
authorDaniel Stenberg <daniel@haxx.se>
Fri, 20 May 2005 10:40:32 +0000 (10:40 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 20 May 2005 10:40:32 +0000 (10:40 +0000)
to the docs.

tests/FILEFORMAT
tests/data/test75
tests/runtests.pl

index 616adcda355d6d733eba2aa20a2ff72f710af672..57850fb64d8d39458af693b993fed102f73a163d 100644 (file)
@@ -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
 </protocol>
-<stdout>
+<stdout [mode=text]>
 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>
-<file name="log/filename">
-the file's contents must be identical to this
+<file name="log/filename" [mode=text]>
+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>
 <stripfile>
 One perl op per line that operates on the file before being compared. This is
index 08cf41ca6413ab5aa87c0bbae871a430ff6905c2..1458cbc1c758bca99036a762e58c3a527221ca3e 100644 (file)
@@ -33,7 +33,7 @@ HTTP, urlglob retrieval with bad range
 <errorcode>
 3
 </errorcode>
-<stdout>
+<stdout mode=text>
 curl: (3) [globbing] error: illegal pattern or range specification after pos 24
 
 </stdout>
index 0ba5d8bc1ceaef2a672b97f12950287a8a86a969..765c38c832e6c22fffec0d5a9bac79f1b4e8e32d 100755 (executable)
@@ -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;