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 $here/../src/pspp --testing-mode -o raw-ascii $TEMPDIR/compute.stat
74 if [ $? -ne 0 ] ; then no_result ; fi
76 diff -B -b $TEMPDIR/pspp.list - <<EOF
77 1.1 DATA LIST. Reading 1 record from the command file.
78 +--------+------+-------+------+
79 |Variable|Record|Columns|Format|
80 #========#======#=======#======#
82 +--------+------+-------+------+
85 --- ------ -------- --------
86 123 ***1@@ 123.00 123.00
87 456 ***4@@ 456.00 456.00
88 919 ***9@@ 919.00 919.00
89 572 ***5@@ 572.00 572.00
92 if [ $? -ne 0 ] ; then fail ; fi