Re: no-xmailer tests fail under Mac OS
From: Jeff King <hidden>
Date: 2016-06-15 23:03:13
On Fri, Dec 05, 2014 at 10:27:40PM -0800, Michael Blume wrote:
quoted
We have had trouble in the past with "wc -l" output not being strictly portable. I do not recall offhand which systems, but it is a good bet that this is the culprit. Doing: grep ^X-Mailer: out >mailer && test_line_count = $expected mailer should fix it. It might be even nicer to actually compare the x-mailer line we find to an expected output, but that may introduce complications if the value changes with the version or something (you'd have to sanitize the output, and then I do not know that the test is really buying much over just seeing whether it exists). -PeffActually need to drop the '&&', but yes, that works perfectly, thanks =)
Ah, right, we might be looking for 0 sometimes. The right way to do it
without destroying the &&-chaining is:
{ grep ^X-Mailer: out || true } &&
test_line_count = $expected mailer
-Peff