diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index 26dae3e23f..5fe09aa3db 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -712,12 +712,17 @@ server is used), if `nonewline` is set, we cut off the trailing newline of this given data before comparing with the one actually sent by the client The `` and `` rules are applied before comparisons are made. -### `` +### `` This verifies that this data was passed to stderr. Use the mode="text" attribute if the output is in text mode on platforms that have a text/binary difference. +Use the mode="warn" attribute if the output curl warning output, as it then +makes the check without newlines and the prefix to better handle that the +lines may wrap at different points depending on the lengths of the lines and +terminal width. + `crlf=yes` forces the newlines to become CRLF even if not written so in the test. diff --git a/tests/data/test1712 b/tests/data/test1712 index 2466939ff2..198b5e17ad 100644 --- a/tests/data/test1712 +++ b/tests/data/test1712 @@ -53,7 +53,7 @@ Content-Type: application/x-www-form-urlencoded 'arg-with-quote' - + Warning: %LOGDIR/config:1 Option 'data' uses argument with leading single quote.%SP Warning: It is probably a mistake. Consider double quotes. diff --git a/tests/runtests.pl b/tests/runtests.pl index e0bc468f10..d8ac67a670 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -1346,6 +1346,14 @@ sub singletest_check { normalize_text(\@validstderr); normalize_text(\@actual); } + if($filemode && ($filemode eq "warn")) { + map { 's/Warning: //' } (@validstderr); + map { 's/\r//' } (@validstderr); + map { 's/\n/ /' } (@validstderr); + map { 's/Warning: //' } (@actual); + map { 's/\r//' } (@actual); + map { 's/\n/ /' } (@actual); + } if($hash{'nonewline'}) { # Yes, we must cut off the final newline from the final line