]> granicus.if.org Git - curl/commitdiff
Daniel Egger provided 'nonewline=yes' support for the <stdout> section
authorDaniel Stenberg <daniel@haxx.se>
Fri, 4 Jan 2008 23:31:04 +0000 (23:31 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 4 Jan 2008 23:31:04 +0000 (23:31 +0000)
tests/FILEFORMAT
tests/runtests.pl

index 550bcb614f35daca56018152dfda9d4c098058a0..b29084bd6cb9af8dce0f0f14b8ae53c56f94adb1 100644 (file)
@@ -275,11 +275,14 @@ off the trailing newline of this given data before comparing with the one
 actually sent by the client
 Variables are substituted as in the <command> section.
 </protocol>
-<stdout [mode="text"]>
+<stdout [mode="text"] [nonewline=yes]>
 This verifies 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.
+
+If 'nonewline' is set, we will cut off the trailing newline of this given data
+before comparing with the one actually received by the client
 </stdout>
 <file name="log/filename" [mode="text"]>
 The file's contents must be identical to this after the test is complete.
index 231d756756f800b706c65f4b3664b8f22f4fe25a..6a5f4a05dc56ba37d6c2baabb7cf2c1e4ba71440 100755 (executable)
@@ -2042,6 +2042,12 @@ sub singletest {
             map s/\r\n/\n/g, @actual;
         }
 
+        if($hash{'nonewline'}) {
+            # Yes, we must cut off the final newline from the final line
+            # of the protocol data
+            chomp($validstdout[$#validstdout]);
+        }
+
         $res = compare("stdout", \@actual, \@validstdout);
         if($res) {
             return 1;