]> granicus.if.org Git - curl/commitdiff
support for using protocol without a trailing newline
authorDaniel Stenberg <daniel@haxx.se>
Fri, 22 Feb 2002 10:50:36 +0000 (10:50 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 22 Feb 2002 10:50:36 +0000 (10:50 +0000)
tests/FILEFORMAT
tests/runtests.pl

index 91dfba7f32a63bdbd255b27c5310db31a3ed2e12..6eb143485e0193c4092dcc6e73b42a15712c37e2 100644 (file)
@@ -62,8 +62,10 @@ One regex per line that is removed from the protocol dumps before the
 comparison is made. This is very useful to remove dependencies on dynamicly
 changing protocol data such as port numbers or user-agent strings.
 </strip>
-<protocol>
-the protocol dump curl should transmit
+<protocol [nonewline=yes]>
+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>
 This verfies that this data was passed to stdout.
index 22cc8f873e03d5ba32806db78ea8cef5a952b306..1ab8b5e8c1e0bf95f272e05088b5bd7fc6c94ca8 100755 (executable)
@@ -602,6 +602,15 @@ sub singletest {
 
         my @protstrip=@protocol;
 
+        # check if there's any attributes on the verify/protocol section
+        my %hash = getpartattr("verify", "protocol");
+
+        if($hash{'nonewline'}) {
+            # Yes, we must cut off the final newline from the final line
+            # of the protocol data
+            chomp($protstrip[$#protstrip]);
+        }
+
         for(@strip) {
             # strip all patterns from both arrays
             @out = striparray( $_, \@out);