From c0ed03fd27298cf2b18f0fb373e919ab8b4ae4f4 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 20 Dec 2003 03:14:26 +0000 Subject: [PATCH] Fixed some buglets in the tests --- config/devices | 2 +- tests/command/aggregate.sh | 2 - tests/command/descriptives.sh | 70 +- tests/command/file-label.sh | 9 +- tests/command/list.sh | 10012 +++++++++++++++++++++++++++++++- tests/command/print.sh | 9920 ++++++++++++++++++++++++++++++- tests/command/sample.sh | 46 +- tests/command/sys-info.sh | 1 - tests/command/tabs.sh | 3 +- tests/command/weight.sh | 25 +- 10 files changed, 19858 insertions(+), 232 deletions(-) diff --git a/config/devices b/config/devices index bc28ed60..47c953e9 100644 --- a/config/devices +++ b/config/devices @@ -58,7 +58,7 @@ tty-ascii:ascii:screen:char-set=ascii output-file=${tty-output-file} \ ${no-attributes} list-ascii:ascii:listing:length=66 width=79 char-set=ascii \ output-file=${list-output-file} ${no-attributes} -raw-ascii:ascii:screen:length=9999 char-set=ascii \ +raw-ascii:ascii:screen:width=9999 length=9999 char-set=ascii \ output-file=${list-output-file} ${no-attributes} headers=off paginate=off # ASCII devices that support bold & underline via backspacing. diff --git a/tests/command/aggregate.sh b/tests/command/aggregate.sh index 597217f8..90c1351f 100755 --- a/tests/command/aggregate.sh +++ b/tests/command/aggregate.sh @@ -72,8 +72,6 @@ activity="run program" $here/../src/pspp -o raw-ascii $TEMPDIR/test.sps if [ $? -ne 0 ] ; then no_result ; fi -cat pspp.list > /tmp/foo - activity="test result" diff -b -w -B $TEMPDIR/pspp.list - << EOF X Z FOO diff --git a/tests/command/descriptives.sh b/tests/command/descriptives.sh index b19c9ce2..20dfeeac 100755 --- a/tests/command/descriptives.sh +++ b/tests/command/descriptives.sh @@ -73,7 +73,6 @@ activity="run program" $here/../src/pspp -o raw-ascii $TEMPDIR/descript.stat if [ $? -ne 0 ] ; then no_result ; fi - activity="compare output" diff -B -b $TEMPDIR/pspp.list - < $TEMPDIR/pspp.filtered if [ $? -ne 0 ] ; then no_result ; fi + activity="compare results" diff -b -B $TEMPDIR/pspp.filtered - < $TEMPDIR/sample.stat < $TEMPDIR/head +if [ $? -ne 0 ] ; then no_result ; fi + +activity="extract data" +grep '[0-9][0-9]*' $TEMPDIR/pspp.list > $TEMPDIR/data +if [ $? -ne 0 ] ; then no_result ; fi + +activity="compare head" +diff -B -b $TEMPDIR/head - << EOF A -- - 2 - 6 - 9 -10 EOF if [ $? -ne 0 ] ; then fail ; fi +activity="compare data" +diff -w $TEMPDIR/data - << EOF > $TEMPDIR/diffs +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +EOF +# note vv +if [ $? -eq 0 ] ; then fail ; fi + +# Check that there was nothing added +grep '^<' $TEMPDIR/diffs +# note vv +if [ $? -eq 0 ] ; then fail ; fi + + pass; diff --git a/tests/command/sys-info.sh b/tests/command/sys-info.sh index 35a64c87..96420ae0 100755 --- a/tests/command/sys-info.sh +++ b/tests/command/sys-info.sh @@ -59,7 +59,6 @@ display $JDATE. finish. EOF if [ $? -ne 0 ] ; then no_result ; fi -cp $TEMPDIR/pspp.list /tmp/bar activity="run program 1" $here/../src/pspp --testing-mode -o raw-ascii $TEMPDIR/save.stat diff --git a/tests/command/tabs.sh b/tests/command/tabs.sh index db0c688a..0a2915f3 100755 --- a/tests/command/tabs.sh +++ b/tests/command/tabs.sh @@ -70,6 +70,7 @@ activity="run program" $here/../src/pspp -o raw-ascii $TEMPDIR/tabs.stat if [ $? -ne 0 ] ; then no_result ; fi + diff -B -b $TEMPDIR/pspp.list - << EOF 1.1 DATA LIST. Reading 1 record from the command file. +--------+------+-------+------+ @@ -77,7 +78,7 @@ diff -B -b $TEMPDIR/pspp.list - << EOF #========#======#=======#======# |X | 1| 1- 80|A80 | +--------+------+-------+------+ - 1 12 123 1234 12345 123456 1234567 + 1 12 123 1234 12345 123456 1234567 12345678 EOF if [ $? -ne 0 ] ; then fail ; fi diff --git a/tests/command/weight.sh b/tests/command/weight.sh index 6446c344..aaa633bc 100755 --- a/tests/command/weight.sh +++ b/tests/command/weight.sh @@ -61,10 +61,9 @@ activity="run program" $here/../src/pspp --testing-mode -o raw-ascii $TEMPDIR/weight.stat if [ $? -ne 0 ] ; then no_result ; fi - activity="compare results" diff -B -b $TEMPDIR/pspp.list - <