X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fcommand%2Frank.sh;h=626778828f613b7d72521a83322e774df432fd9b;hb=751d7694b0904b580fad3903205341c85c04d421;hp=aac20882562b89c8663f83ba80cace54dd56896f;hpb=1255b66223eac8ff1b0abf138ead22fd801c6633;p=pspp diff --git a/tests/command/rank.sh b/tests/command/rank.sh index aac2088256..626778828f 100755 --- a/tests/command/rank.sh +++ b/tests/command/rank.sh @@ -11,7 +11,7 @@ if [ -z "$top_builddir" ] ; then top_builddir=. ; fi top_srcdir=`cd $top_srcdir; pwd` top_builddir=`cd $top_builddir; pwd` -PSPP=$top_builddir/src/ui/terminal/pspp +PSPP=$top_builddir/src/ui/terminal/pspp$EXEEXT STAT_CONFIG_PATH=$top_srcdir/config export STAT_CONFIG_PATH @@ -26,6 +26,7 @@ cleanup() echo "NOT cleaning $TEMPDIR" return ; fi + cd / rm -rf $TEMPDIR } @@ -81,7 +82,7 @@ if [ $? -ne 0 ] ; then no_result ; fi # Check that it properly handles failed transformations. activity="run program 1" -$SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE > $TEMPDIR/err +$SUPERVISOR $PSPP --testing-mode -o pspp.csv -e $TEMPDIR/err $TESTFILE if [ $? -ne 1 ] ; then fail ; fi activity="diff 1" @@ -125,27 +126,21 @@ RANK x * Too many variables in INTO RANK x /RANK INTO foo bar wiz. - -* Alpha group -RANK x BY a. - - EOF if [ $? -ne 0 ] ; then no_result ; fi activity="run program (syntax errors)" -$SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE > $TEMPDIR/errs +$SUPERVISOR $PSPP -o pspp.csv -e $TEMPDIR/errs $TESTFILE if [ $? -ne 1 ] ; then fail ; fi activity="compare errors" perl -pi -e 's/^\s*$//g' $TEMPDIR/errs -diff -b $TEMPDIR/errs - << EOF -$TEMPDIR/rank.sh.sps:15: error: RANK: Syntax error expecting \`(' at end of command. -$TEMPDIR/rank.sh.sps:19: error: RANK: Syntax error expecting integer at \`d'. +diff -b $TEMPDIR/errs - << EOF +$TEMPDIR/rank.sh.sps:15: error: RANK: Syntax error at end of command: expecting \`('. +$TEMPDIR/rank.sh.sps:19: error: RANK: Syntax error at \`d': expecting integer. $TEMPDIR/rank.sh.sps:25: error: RANK: Variable x already exists. $TEMPDIR/rank.sh.sps:30: error: RANK: Too many variables in INTO clause. -$TEMPDIR/rank.sh.sps:33: warning: RANK: a is not a numeric variable. It will not be included in the variable list. EOF if [ $? -ne 0 ] ; then fail ; fi @@ -251,6 +246,11 @@ LIST. NEW FILE. DATA LIST LIST NOTABLE /a * g1 g2 *. BEGIN DATA. +2 1 2 +2 1 2 +3 1 2 +4 1 2 +5 1 2 1 0 2 2 0 2 3 0 2 @@ -259,11 +259,6 @@ BEGIN DATA. 6 0 2 7 0 2 8 0 2 -2 1 2 -2 1 2 -3 1 2 -4 1 2 -5 1 2 6 1 2 7 1 2 7 1 2 @@ -280,6 +275,19 @@ RANK a (D) BY g2 g1 /NORMAL . +SPLIT FILE BY g1. + +RANK a (D) BY g2 + /PRINT=YES + /TIES=LOW + /MISSING=INCLUDE + /FRACTION=RANKIT + /RANK + /NORMAL + . + +SPLIT FILE OFF. + LIST. @@ -351,160 +359,247 @@ if [ $? -ne 0 ] ; then no_result ; fi activity="run program 3" -$SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE +$SUPERVISOR $PSPP -o pspp.csv $TESTFILE if [ $? -ne 0 ] ; then no_result ; fi activity="compare output 3" -perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list -diff -b $TEMPDIR/pspp.list - < /dev/null +$SUPERVISOR $PSPP -o pspp.csv -e /dev/null $TESTFILE if [ $? -ne 0 ] ; then fail ; fi activity="compare output 4" -perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list -diff -b $TEMPDIR/pspp.list - << EOF +diff -c $TEMPDIR/pspp.csv - << EOF +"$TEMPDIR/rank.sh.sps:3: warning: BEGIN DATA: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." + +"$TEMPDIR/rank.sh.sps:4: warning: BEGIN DATA: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." + +"$TEMPDIR/rank.sh.sps:5: warning: BEGIN DATA: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." + +"$TEMPDIR/rank.sh.sps:6: warning: BEGIN DATA: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." + +"$TEMPDIR/rank.sh.sps:7: warning: BEGIN DATA: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." + +"$TEMPDIR/rank.sh.sps:8: warning: BEGIN DATA: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." + +"$TEMPDIR/rank.sh.sps:9: warning: BEGIN DATA: Missing value(s) for all variables from rx onward. These will be filled with the system-missing value or blanks, as appropriate." + Variables Created By RANK + + + x into RNKRA01(RANK of x) - x rx RNKRA01 --------- -------- --------- - 1.00 . 1.000 - 2.00 . 2.000 - 3.00 . 3.000 - 4.00 . 4.000 - 5.00 . 5.000 - 6.00 . 6.000 - 7.00 . 7.000 + +Table: Data List +x,rx,RNKRA01 +1.00,. ,1.000 +2.00,. ,2.000 +3.00,. ,3.000 +4.00,. ,4.000 +5.00,. ,5.000 +6.00,. ,6.000 +7.00,. ,7.000 EOF if [ $? -ne 0 ] ; then fail ; fi