From ae8a8c8ba44409c31928e60d8f55cfc1a349bc2d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 22 Feb 2002 10:50:36 +0000 Subject: [PATCH] support for using protocol without a trailing newline --- tests/FILEFORMAT | 6 ++++-- tests/runtests.pl | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/FILEFORMAT b/tests/FILEFORMAT index 91dfba7f3..6eb143485 100644 --- a/tests/FILEFORMAT +++ b/tests/FILEFORMAT @@ -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. - -the protocol dump curl should transmit + +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. diff --git a/tests/runtests.pl b/tests/runtests.pl index 22cc8f873..1ab8b5e8c 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -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);