From f5012ca454b1cb05ca52decbd4b0a79776ca5feb Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Thu, 22 Mar 2018 13:38:02 +1300 Subject: [PATCH] cavern.tst: Workaround more Apple tool limitations --- tests/cavern.tst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/cavern.tst b/tests/cavern.tst index ace47d8c..c6b8e43f 100755 --- a/tests/cavern.tst +++ b/tests/cavern.tst @@ -180,9 +180,10 @@ for file in $TESTS ; do exit 1 fi fi - # m* would ideally be m\? but Apple's stone-age sed doesn't support \?. - nan=`sed 's/.*\<[Nn]a[Nn]m*\>.*/x/p;d' tmp.out` - if test -n "$nan" ; then + # Fail if nan, NaN, etc in output (which might be followed by m for metres or + # s for seconds). + if egrep -q '(^|[^A-Za-z0-9])nan[ms]?($|[^A-Za-z0-9])' tmp.out ; then + echo "Not-a-number appears in output" exit 1 fi -- 2.11.4.GIT