From 7e8eec6839205801adddbd6fafb2ceaf7c601d08 Mon Sep 17 00:00:00 2001
From: Jason Stover <jhs@math.gcsu.edu>
Date: Mon, 10 Oct 2005 20:49:13 +0000
Subject: [PATCH] Made tests BSD diff compatible

---
 tests/command/count.sh               | 3 ++-
 tests/command/data-list.sh           | 3 ++-
 tests/command/examine-extremes.sh    | 3 ++-
 tests/command/examine-percentiles.sh | 3 ++-
 tests/command/examine.sh             | 3 ++-
 tests/command/file-label.sh          | 3 ++-
 tests/command/filter.sh              | 3 ++-
 tests/command/flip.sh                | 3 ++-
 tests/command/import-export.sh       | 3 ++-
 tests/command/lag.sh                 | 3 ++-
 tests/command/list.sh                | 3 ++-
 tests/command/longvars.sh            | 3 ++-
 tests/command/loop.sh                | 3 ++-
 tests/command/oneway-with-splits.sh  | 3 ++-
 tests/command/oneway.sh              | 3 ++-
 tests/command/print.sh               | 3 ++-
 tests/command/rename.sh              | 3 ++-
 tests/command/split-file.sh          | 3 ++-
 tests/command/sysfiles-old.sh        | 3 ++-
 tests/command/sysfiles.sh            | 3 ++-
 tests/command/t-test-1-indep-val.sh  | 3 ++-
 tests/command/t-test-1s.sh           | 3 ++-
 tests/command/t-test-groups.sh       | 3 ++-
 tests/command/t-test-pairs.sh        | 3 ++-
 tests/command/tabs.sh                | 3 ++-
 tests/command/trimmed-mean.sh        | 3 ++-
 tests/command/use.sh                 | 3 ++-
 tests/command/weight.sh              | 3 ++-
 28 files changed, 56 insertions(+), 28 deletions(-)

diff --git a/tests/command/count.sh b/tests/command/count.sh
index 0b5b751e..351d636f 100755
--- a/tests/command/count.sh
+++ b/tests/command/count.sh
@@ -73,7 +73,8 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="compare results"
-diff -b -B $TEMPDIR/pspp.list - <<EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff -b  $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading 1 record from the command file.
 +--------+------+-------+------+
 |Variable|Record|Columns|Format|
diff --git a/tests/command/data-list.sh b/tests/command/data-list.sh
index 4206e498..99b94aa5 100755
--- a/tests/command/data-list.sh
+++ b/tests/command/data-list.sh
@@ -106,7 +106,8 @@ $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii --testing-mode $TESTFI
 if [ $? -ne 0 ] ; then fail ; fi
 
 activity="compare output"
-diff -b -B $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff -b  $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading free-form data from the command file.
 +--------+------+
 |Variable|Format|
diff --git a/tests/command/examine-extremes.sh b/tests/command/examine-extremes.sh
index b10fdbca..afecfa56 100755
--- a/tests/command/examine-extremes.sh
+++ b/tests/command/examine-extremes.sh
@@ -89,7 +89,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare results"
-diff -b -B $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff -b  $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
 1.1 EXAMINE.  Case Processing Summary
 #==#===============================#
 #  #             Cases             #
diff --git a/tests/command/examine-percentiles.sh b/tests/command/examine-percentiles.sh
index 0d23b41f..21b88a04 100755
--- a/tests/command/examine-percentiles.sh
+++ b/tests/command/examine-percentiles.sh
@@ -82,7 +82,8 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="compare results"
-diff -b -B $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff -b  $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading free-form data from the command file.
 +--------+------+
 |Variable|Format|
diff --git a/tests/command/examine.sh b/tests/command/examine.sh
index 445e1dfc..1136267f 100755
--- a/tests/command/examine.sh
+++ b/tests/command/examine.sh
@@ -94,7 +94,8 @@ if [ $? -ne 0 ] ; then no_result ; fi
 # NOTE:  In the following data: Only the extreme values have been checked
 # The descriptives have been blindly pasted.
 activity="compare results"
-diff -b -B $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff -b  $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading free-form data from the command file.
 +--------+------+
 |Variable|Format|
diff --git a/tests/command/file-label.sh b/tests/command/file-label.sh
index aaf404f4..83999094 100755
--- a/tests/command/file-label.sh
+++ b/tests/command/file-label.sh
@@ -116,7 +116,8 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="compare results"
-diff -b -B $TEMPDIR/pspp.filtered - <<EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff -b  $TEMPDIR/pspp.filtered - <<EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading 1 record from the command file.
 +--------+------+-------+------+
 |Variable|Record|Columns|Format|
diff --git a/tests/command/filter.sh b/tests/command/filter.sh
index 4e955913..b6ab48f0 100755
--- a/tests/command/filter.sh
+++ b/tests/command/filter.sh
@@ -83,7 +83,8 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="check results"
-diff -B -b $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff  -b $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
  X FILTER_$
 -- --------
  1     1.00 
diff --git a/tests/command/flip.sh b/tests/command/flip.sh
index 60de8395..f4eb926f 100755
--- a/tests/command/flip.sh
+++ b/tests/command/flip.sh
@@ -72,7 +72,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/flip.stat
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare output"
-diff  -b -B $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff  -b  $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading 1 record from the command file.
 +--------+------+-------+------+
 |Variable|Record|Columns|Format|
diff --git a/tests/command/import-export.sh b/tests/command/import-export.sh
index 74a27543..de8a147d 100755
--- a/tests/command/import-export.sh
+++ b/tests/command/import-export.sh
@@ -70,7 +70,8 @@ $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare output"
-diff -b -B $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff -b  $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
        X        Y
 -------- --------
     1.00     2.00 
diff --git a/tests/command/lag.sh b/tests/command/lag.sh
index 579fd5af..70d46e95 100755
--- a/tests/command/lag.sh
+++ b/tests/command/lag.sh
@@ -71,7 +71,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/lag.stat
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare result"
-diff -b -B $TEMPDIR/pspp.list - <<EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff -b  $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading 1 record from the command file.
 +--------+------+-------+------+
 |Variable|Record|Columns|Format|
diff --git a/tests/command/list.sh b/tests/command/list.sh
index 13801abc..58098ebf 100755
--- a/tests/command/list.sh
+++ b/tests/command/list.sh
@@ -73,7 +73,8 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="compare results"
-diff -b -B $TEMPDIR/pspp.list - <<EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff -b  $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading 1 record from file $top_srcdir/tests/weighting.data.
 +--------+------+-------+------+
 |Variable|Record|Columns|Format|
diff --git a/tests/command/longvars.sh b/tests/command/longvars.sh
index 063ad6bb..8571ab5b 100755
--- a/tests/command/longvars.sh
+++ b/tests/command/longvars.sh
@@ -71,7 +71,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare output"
-diff -B -b $TEMPDIR/pspp.list - <<EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff  -b $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading free-form data from the command file.
 +--------------+------+
 |   Variable   |Format|
diff --git a/tests/command/loop.sh b/tests/command/loop.sh
index f06f61a8..f5bfc92a 100755
--- a/tests/command/loop.sh
+++ b/tests/command/loop.sh
@@ -76,7 +76,8 @@ EOF
 if [ $? -ne 0 ] ; then fail ; fi
 
 activity="compare results"
-diff -B -b $TEMPDIR/pspp.list  - <<EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff  -b $TEMPDIR/pspp.list  - <<EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading 1 record from the command file.
 +----------+------+-------+------+
 | Variable |Record|Columns|Format|
diff --git a/tests/command/oneway-with-splits.sh b/tests/command/oneway-with-splits.sh
index 333c66b3..4de77213 100755
--- a/tests/command/oneway-with-splits.sh
+++ b/tests/command/oneway-with-splits.sh
@@ -95,7 +95,8 @@ activity="run program"
 $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
-diff -b -B $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff -b  $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading free-form data from the command file.
 +--------+------+
 |Variable|Format|
diff --git a/tests/command/oneway.sh b/tests/command/oneway.sh
index 91a72af6..5de91674 100755
--- a/tests/command/oneway.sh
+++ b/tests/command/oneway.sh
@@ -92,7 +92,8 @@ activity="run program"
 $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
-diff -b -B $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff -b  $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading free-form data from the command file.
 +--------+------+
 |Variable|Format|
diff --git a/tests/command/print.sh b/tests/command/print.sh
index ca346023..1f135d9b 100755
--- a/tests/command/print.sh
+++ b/tests/command/print.sh
@@ -98,7 +98,8 @@ if [ $? -ne 0 ] ; then fail ; fi
 
 
 activity="compare output"
-diff -b -B $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff -b  $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading free-form data from file $TEMPDIR/data-list.data.
 +--------+------+
 |Variable|Format|
diff --git a/tests/command/rename.sh b/tests/command/rename.sh
index c5d3ecfc..2c43d3a7 100755
--- a/tests/command/rename.sh
+++ b/tests/command/rename.sh
@@ -78,7 +78,8 @@ grep -i Brake $TEMPDIR/rename.sav
 if [ $? -eq 0 ] ; then fail ; fi
 
 activity="compare output"
-diff -B -b $TEMPDIR/pspp.list - <<EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff  -b $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading free-form data from the command file.
 +----------+------+
 | Variable |Format|
diff --git a/tests/command/split-file.sh b/tests/command/split-file.sh
index f9ae79ab..7a992a16 100755
--- a/tests/command/split-file.sh
+++ b/tests/command/split-file.sh
@@ -78,7 +78,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/split.stat
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare results"
-diff -B -b $TEMPDIR/pspp.list - <<EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff  -b $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
 Variable Value Label
 X            1
 
diff --git a/tests/command/sysfiles-old.sh b/tests/command/sysfiles-old.sh
index 6e23c97f..0931a0af 100755
--- a/tests/command/sysfiles-old.sh
+++ b/tests/command/sysfiles-old.sh
@@ -89,7 +89,8 @@ grep  'X=X' $TEMPDIR/foo.sav
 if [ $? -eq 0 ] ; then fail ; fi
 
 activity="compare output"
-diff -b -B -w $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff -b  -w $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
        X VARIABLE VARIAB_A VARIAB_B
 -------- -------- -------- --------
     1.00     1.00     1.00     2.00 
diff --git a/tests/command/sysfiles.sh b/tests/command/sysfiles.sh
index 48f561bc..0dd6c5fe 100755
--- a/tests/command/sysfiles.sh
+++ b/tests/command/sysfiles.sh
@@ -79,7 +79,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare output"
-diff -b -B -w $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff -b  -w $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
 variable001 variable002 variable003 variable004
 ----------- ----------- ----------- -----------
        1.00        1.00        1.00        2.00  
diff --git a/tests/command/t-test-1-indep-val.sh b/tests/command/t-test-1-indep-val.sh
index e149ac79..01582f21 100755
--- a/tests/command/t-test-1-indep-val.sh
+++ b/tests/command/t-test-1-indep-val.sh
@@ -87,7 +87,8 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="compare output"
-diff -B -b $TEMPDIR/pspp.list - <<EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff  -b $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading free-form data from the command file.
 +--------+------+
 |Variable|Format|
diff --git a/tests/command/t-test-1s.sh b/tests/command/t-test-1s.sh
index 2e18365c..488cf20a 100755
--- a/tests/command/t-test-1s.sh
+++ b/tests/command/t-test-1s.sh
@@ -70,7 +70,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare output"
-diff -B -b $TEMPDIR/pspp.list - <<EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff  -b $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading free-form data from the command file.
 +--------+------+
 |Variable|Format|
diff --git a/tests/command/t-test-groups.sh b/tests/command/t-test-groups.sh
index ca0cca45..8e388afa 100755
--- a/tests/command/t-test-groups.sh
+++ b/tests/command/t-test-groups.sh
@@ -77,7 +77,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare output"
-diff -B -b $TEMPDIR/pspp.list - <<EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff  -b $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading free-form data from the command file.
 +--------+------+
 |Variable|Format|
diff --git a/tests/command/t-test-pairs.sh b/tests/command/t-test-pairs.sh
index b3ef8415..7932b707 100755
--- a/tests/command/t-test-pairs.sh
+++ b/tests/command/t-test-pairs.sh
@@ -69,7 +69,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare output"
-diff -B -b $TEMPDIR/pspp.list - <<EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff  -b $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading free-form data from the command file.
 +--------+------+
 |Variable|Format|
diff --git a/tests/command/tabs.sh b/tests/command/tabs.sh
index 606c0a4c..93f4c01d 100755
--- a/tests/command/tabs.sh
+++ b/tests/command/tabs.sh
@@ -74,7 +74,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/tabs.stat
 if [ $? -ne 0 ] ; then no_result ; fi
 
 
-diff -B -b $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff  -b $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading 1 record from the command file.
 +--------+------+-------+------+
 |Variable|Record|Columns|Format|
diff --git a/tests/command/trimmed-mean.sh b/tests/command/trimmed-mean.sh
index a5d74e12..1fc45c70 100755
--- a/tests/command/trimmed-mean.sh
+++ b/tests/command/trimmed-mean.sh
@@ -75,7 +75,8 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="compare results"
-diff -b -B $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff -b  $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading free-form data from the command file.
 +--------+------+
 |Variable|Format|
diff --git a/tests/command/use.sh b/tests/command/use.sh
index bbbb7b44..415314d6 100755
--- a/tests/command/use.sh
+++ b/tests/command/use.sh
@@ -76,7 +76,8 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="check results"
-diff -B -b $TEMPDIR/pspp.list - << EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff  -b $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
  X
 --
  1
diff --git a/tests/command/weight.sh b/tests/command/weight.sh
index d2840edd..44995fc1 100755
--- a/tests/command/weight.sh
+++ b/tests/command/weight.sh
@@ -66,7 +66,8 @@ $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare results"
-diff -B -b $TEMPDIR/pspp.list - <<EOF
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff  -b $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
 1.1 DATA LIST.  Reading 1 record from file $top_srcdir/tests/weighting.data.
 +--------+------+-------+------+
 |Variable|Record|Columns|Format|
-- 
2.30.2