]> granicus.if.org Git - curl/commitdiff
more nonewline support
authorDaniel Stenberg <daniel@haxx.se>
Tue, 11 Jun 2002 15:11:41 +0000 (15:11 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 11 Jun 2002 15:11:41 +0000 (15:11 +0000)
tests/FILEFORMAT
tests/runtests.pl

index 6eb143485e0193c4092dcc6e73b42a15712c37e2..c64423ef45326009fd38d636d33d29d4e44b4e2f 100644 (file)
@@ -19,8 +19,10 @@ data to sent to the client on its request and later verified that it arrived
 safely. Set the nocheck=1 to prevent the test script to verify the arrival
 of this data.
 </data>
-<datacheck>
-if the data is sent but this is what should be checked afterwards
+<datacheck [nonewline=yes]>
+if the data is sent but this is what should be checked afterwards. 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
 </datacheck>
 <size>
 number to return on a ftp SIZE command
index a9b6e6ff31ba279321403cff1cf58b9c98915dd4..c7c95a2227ac3e8cff6ce6e5cfff0dbabae67ec5 100755 (executable)
@@ -471,6 +471,14 @@ sub singletest {
 
     if (@replycheck) {
         # we use this file instead to check the final output against
+
+        my %hash = getpartattr("reply", "datacheck");
+        if($hash{'nonewline'}) {
+            # Yes, we must cut off the final newline from the final line
+            # of the datacheck
+            chomp($replycheck[$#replycheck]);
+        }
+    
         @reply=@replycheck;
     }