3 # This program tests the COMPUTE command
4 # (it also gives LPAD and RPAD a work out)
6 TEMPDIR=/tmp/pspp-tst-$$
10 # ensure that top_srcdir is absolute
11 cd $top_srcdir; top_srcdir=`pwd`
13 export STAT_CONFIG_PATH=$top_srcdir/config
49 activity="create program"
50 cat > $TEMPDIR/compute.stat <<EOF
61 compute y=number(w,f8).
64 substr(string(x,f6),4,1),
70 if [ $? -ne 0 ] ; then no_result ; fi
73 activity="run program"
74 $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TEMPDIR/compute.stat
75 if [ $? -ne 0 ] ; then no_result ; fi
77 diff -B -b $TEMPDIR/pspp.list - <<EOF
78 1.1 DATA LIST. Reading 1 record from the command file.
79 +--------+------+-------+------+
80 |Variable|Record|Columns|Format|
81 #========#======#=======#======#
83 +--------+------+-------+------+
86 --- ------ -------- --------
87 123 ***1@@ 123.00 123.00
88 456 ***4@@ 456.00 456.00
89 919 ***9@@ 919.00 919.00
90 572 ***5@@ 572.00 572.00
93 if [ $? -ne 0 ] ; then fail ; fi