From: John Darrington <john@darrington.wattle.id.au>
Date: Sat, 30 Oct 2010 16:16:32 +0000 (+0200)
Subject: Make tests which use wc more robust.
X-Git-Tag: v0.7.7~154
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37c5ded73d52bfa1962d0ec352402b4e894c6c9a;p=pspp-builds.git

Make tests which use wc more robust.

It appears that some systems' "wc" command  format their output
differently.  So this change uses a numeric comparison rather
than a string comparison.
---

diff --git a/tests/data/data-in.at b/tests/data/data-in.at
index bfdf9ef5..03125b55 100644
--- a/tests/data/data-in.at
+++ b/tests/data/data-in.at
@@ -3413,8 +3413,7 @@ AT_CLEANUP
 
 AT_SETUP([binary and hexadecimal input (IB, PIB, and PIBHEX formats)])
 AT_CHECK([$PERL -e 'print pack "n", $_ foreach 0...65535' > binhex-in.data])
-AT_CHECK([wc -c < binhex-in.data], [0], [131072
-])
+AT_CHECK([test `wc -c < binhex-in.data` -eq 131072], [0])
 AT_DATA([binhex-in.sps], [dnl
 SET RIB=MSBFIRST.
 SET ERRORS=NONE.
@@ -3434,8 +3433,7 @@ AT_CLEANUP
 
 AT_SETUP([BCD input (P and PK formats)])
 AT_CHECK([$PERL -e 'print pack "n", $_ foreach 0...65535' > bcd-in.data])
-AT_CHECK([wc -c < bcd-in.data], [0], [131072
-])
+AT_CHECK([test `wc -c < bcd-in.data` -eq 131072], [0])
 AT_DATA([bcd-in.sps], [dnl
 SET ERRORS=NONE.
 SET MXWARNS=10000000.
@@ -3454,8 +3452,7 @@ AT_CLEANUP
 
 AT_SETUP([legacy input (N and Z formats)])
 AT_CHECK([$PERL -e 'print pack "n", $_ foreach 0...65535' > legacy-in.data])
-AT_CHECK([wc -c < legacy-in.data], [0], [131072
-])
+AT_CHECK([test `wc -c < legacy-in.data` -eq 131072], [0])
 AT_DATA([legacy-in.sps], [dnl
 SET ERRORS=NONE.
 SET MXWARNS=10000000.