From: Akim Demaille Date: Fri, 5 Oct 2012 07:20:30 +0000 (+0200) Subject: tests: fix sed portability issues X-Git-Tag: v2.6.90~93 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/a727e7124d0d9f8da52e0f5092b05b356cf03deb tests: fix sed portability issues Reported by Didier Godefroy, . * tests/calc.at (AT_CHECK_SPACES): Use Perl. --- diff --git a/tests/calc.at b/tests/calc.at index 3aab8681..a1c11e5f 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -503,12 +503,15 @@ AT_CHECK([cat stderr], 0, [expout]) # Make sure we did not introduce bad spaces. Checked here because all # the skeletons are (or should be) exercized here. m4_define([AT_CHECK_SPACES], -[# No initial empty lines. -AT_CHECK([sed -ne '/./q;=;p;' $1]) -# No trailing spaces. -# FIXME: For 2.7: AT_CHECK([sed -ne '/[ ]$/{=;p;}' $1]) -# No final empty lines. -AT_CHECK([sed -ne '${/^$/{=;p;};}' $1]) +[AT_CHECK([perl -ne ' + chomp; + print "$.: {$_}\n" + if (# No starting/ending empty lines. + (eof || $. == 1) && /^\s*$/ + # No trailing space. FIXME: not ready for "maint". + # || /\s$/ + )' $1 +])dnl ])