3 # This program tests features of GET DATA /TYPE=TXT input program that
4 # it has in common with DATA LIST, using tests drawn from
7 TEMPDIR=/tmp/pspp-tst-$$
8 TESTFILE=$TEMPDIR/`basename $0`.sps
10 # ensure that top_builddir are absolute
11 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
12 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
13 top_builddir=`cd $top_builddir; pwd`
14 PSPP=$top_builddir/src/ui/terminal/pspp
16 # ensure that top_srcdir is absolute
17 top_srcdir=`cd $top_srcdir; pwd`
19 STAT_CONFIG_PATH=$top_srcdir/config
20 export STAT_CONFIG_PATH
57 # Create command file.
58 activity="create program"
59 cat > $TESTFILE << EOF
60 get data /type=txt /file=inline /delimiters="|X"
61 /variables=A f7.2 B f7.2 C f7.2 D f7.2.
70 get data /type=txt /file=inline /delimiters=', ' /delcase=variables 4
71 /firstcase=2 /variables=A f7.2 B f7.2 C f7.2 D f7.2.
73 # This record is ignored.
89 get data /type=txt /file=inline /delimiters='\t' /delcase=variables 4
90 /firstcase=3 /variables=A f7.2 B f7.2 C f7.2 D f7.2.
113 get data /type=txt /file=inline /arrangement=fixed /fixcase=3 /variables=
130 get data /type=txt /file=inline /arrangement=fixed /fixcase=2 /variables=
147 if [ $? -ne 0 ] ; then no_result ; fi
150 activity="run program"
151 $SUPERVISOR $PSPP --testing-mode $TESTFILE
152 if [ $? -ne 0 ] ; then fail ; fi
154 activity="compare output"
155 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
156 diff -b $TEMPDIR/pspp.list - << EOF
158 -------- -------- -------- --------
159 1.00 23.00 45.00 2.03
160 2.00 22.00 34.00 23.00
161 3.00 34.00 34.00 34.00
163 -------- -------- -------- --------
172 -------- -------- -------- --------
190 -------------------- -------------------- -----
191 07/22/2007 10/06/2007 321
192 07/14/1789 08/26/1789 4
193 01/01/1972 12/31/1999 682
202 if [ $? -ne 0 ] ; then fail ; fi