Daniel Egger provided 'nonewline=yes' support for the <stdout> section
This commit is contained in:
Родитель
2e42b0a252
Коммит
fe0d7aee49
|
@ -275,11 +275,14 @@ off the trailing newline of this given data before comparing with the one
|
||||||
actually sent by the client
|
actually sent by the client
|
||||||
Variables are substituted as in the <command> section.
|
Variables are substituted as in the <command> section.
|
||||||
</protocol>
|
</protocol>
|
||||||
<stdout [mode="text"]>
|
<stdout [mode="text"] [nonewline=yes]>
|
||||||
This verifies that this data was passed to stdout.
|
This verifies that this data was passed to stdout.
|
||||||
|
|
||||||
Use the mode="text" attribute if the output is in text mode on platforms that
|
Use the mode="text" attribute if the output is in text mode on platforms that
|
||||||
have a text/binary difference.
|
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>
|
</stdout>
|
||||||
<file name="log/filename" [mode="text"]>
|
<file name="log/filename" [mode="text"]>
|
||||||
The file's contents must be identical to this after the test is complete.
|
The file's contents must be identical to this after the test is complete.
|
||||||
|
|
|
@ -2042,6 +2042,12 @@ sub singletest {
|
||||||
map s/\r\n/\n/g, @actual;
|
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);
|
$res = compare("stdout", \@actual, \@validstdout);
|
||||||
if($res) {
|
if($res) {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче