From: Ben Pfaff <blp@cs.stanford.edu>
Date: Wed, 3 Nov 2010 03:35:23 +0000 (-0700)
Subject: data-out: Make MONTH, WKDAY tests more portable.
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7466086a5d1e5325d1aa32482c717e349af6b3ea;p=pspp

data-out: Make MONTH, WKDAY tests more portable.

The amount of leading whitespace output by "uniq -c" varies among
platforms, so remove all of it for comparison.

Reported by Jeremy Lavergne <jeremy@lavergne.gotdns.org> on Darwin 10.4.0.
---

diff --git a/tests/data/data-out.at b/tests/data/data-out.at
index 9a41a3b5fd..0b8b4fee9d 100644
--- a/tests/data/data-out.at
+++ b/tests/data/data-out.at
@@ -14009,11 +14009,12 @@ print outfile='month-out.out'/x(month40).
 execute.
 ])
 AT_CHECK([pspp -O format=csv month-out.sps], [1], [stdout])
-AT_CHECK([sed '/^$/d' stdout | sort | uniq -c], [0], [dnl
-     38 error: Month number 0.000000 is not between 1 and 12.
-     38 error: Month number 0.500000 is not between 1 and 12.
-     38 error: Month number 0.900000 is not between 1 and 12.
-     38 error: Month number 13.000000 is not between 1 and 12.
+AT_CHECK([[sed '/^$/d' stdout | sort | uniq -c | sed 's/^[ 	]*//']], [0],
+[dnl
+38 error: Month number 0.000000 is not between 1 and 12.
+38 error: Month number 0.500000 is not between 1 and 12.
+38 error: Month number 0.900000 is not between 1 and 12.
+38 error: Month number 13.000000 is not between 1 and 12.
 ])
 AT_CHECK([cat month-out.out], [0], [dnl
    .
@@ -14924,11 +14925,12 @@ end repeat.
 execute.
 ])
 AT_CHECK([pspp -O format=csv wkday-out.sps], [1], [stdout])
-AT_CHECK([sed '/^$/d' stdout | sort | uniq -c], [0], [dnl
-     39 error: Weekday number 0.000000 is not between 1 and 7.
-     39 error: Weekday number 0.500000 is not between 1 and 7.
-     39 error: Weekday number 0.900000 is not between 1 and 7.
-     39 error: Weekday number 8.000000 is not between 1 and 7.
+AT_CHECK([[sed '/^$/d' stdout | sort | uniq -c | sed 's/^[ 	]*//']], [0],
+[dnl
+39 error: Weekday number 0.000000 is not between 1 and 7.
+39 error: Weekday number 0.500000 is not between 1 and 7.
+39 error: Weekday number 0.900000 is not between 1 and 7.
+39 error: Weekday number 8.000000 is not between 1 and 7.
 ])
 AT_CHECK([cat wkday-out.out], [0], [dnl
   .