3 # This program tests the count transformation
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
10 # ensure that top_srcdir is absolute
11 cd $top_srcdir; top_srcdir=`pwd`
13 STAT_CONFIG_PATH=$top_srcdir/config
14 export STAT_CONFIG_PATH
52 title 'Test COUNT transformation'.
54 * we're going to count the 2s 4s and 1s in the data
55 data list /V1 to V2 1-4(a).
61 1104 ---- this is not '4', but '04' (v1 and v2 are string format )
65 count C=v1 to v2('2',' 4','1').
68 if [ $? -ne 0 ] ; then no_result ; fi
71 $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
72 if [ $? -ne 0 ] ; then no_result ; fi
75 activity="compare results"
76 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
77 diff -b $TEMPDIR/pspp.list - <<EOF
78 1.1 DATA LIST. Reading 1 record from INLINE.
79 +--------+------+-------+------+
80 |Variable|Record|Columns|Format|
81 #========#======#=======#======#
84 +--------+------+-------+------+
95 if [ $? -ne 0 ] ; then no_result ; fi