Added "cd /" to the test scripts which don't already have it. This avoids warnings...
[pspp-builds.git] / tests / command / rank.sh
index c827a5207850fb7a5fc84949d7b3a42892e54d41..d98c8e2211c67b0316334b2973f84ed9e726f00f 100755 (executable)
@@ -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 -e $TEMPDIR/err $TESTFILE 
+$SUPERVISOR $PSPP --testing-mode -e $TEMPDIR/err $TESTFILE 
 if [ $? -ne 1 ] ; then fail ; fi
 
 activity="diff 1"
@@ -125,17 +126,12 @@ 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 -e $TEMPDIR/errs $TESTFILE 
+$SUPERVISOR $PSPP --testing-mode -e $TEMPDIR/errs $TESTFILE 
 if [ $? -ne 1 ] ; then fail ; fi
 
 activity="compare errors"
@@ -145,7 +141,6 @@ $TEMPDIR/rank.sh.sps:15: error: RANK: Syntax error expecting \`(' at end of comm
 $TEMPDIR/rank.sh.sps:19: error: RANK: Syntax error expecting integer at \`d'.
 $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,7 +359,7 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="run program 3"
-$SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE
+$SUPERVISOR $PSPP --testing-mode $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 
@@ -382,26 +390,50 @@ b into Nb(N of b)
 |Variable|Description                                |Position|
 #========#===========================================#========#
 |a       |Format: F8.2                               |       1|
+|        |Measure: Scale                             |        |
+|        |Display Alignment: Right                   |        |
+|        |Display Width: 8                           |        |
 +--------+-------------------------------------------+--------+
 |b       |Format: F8.2                               |       2|
+|        |Measure: Scale                             |        |
+|        |Display Alignment: Right                   |        |
+|        |Display Width: 8                           |        |
 +--------+-------------------------------------------+--------+
 |count   |N of a                                     |       3|
 |        |Format: F6.0                               |        |
+|        |Measure: Scale                             |        |
+|        |Display Alignment: Right                   |        |
+|        |Display Width: 8                           |        |
 +--------+-------------------------------------------+--------+
 |Ra      |RANK of a                                  |       4|
 |        |Format: F9.3                               |        |
+|        |Measure: Scale                             |        |
+|        |Display Alignment: Right                   |        |
+|        |Display Width: 8                           |        |
 +--------+-------------------------------------------+--------+
 |Rb      |RANK of b                                  |       5|
 |        |Format: F9.3                               |        |
+|        |Measure: Scale                             |        |
+|        |Display Alignment: Right                   |        |
+|        |Display Width: 8                           |        |
 +--------+-------------------------------------------+--------+
 |RFR001  |RFRACTION of a                             |       6|
 |        |Format: F6.4                               |        |
+|        |Measure: Scale                             |        |
+|        |Display Alignment: Right                   |        |
+|        |Display Width: 8                           |        |
 +--------+-------------------------------------------+--------+
 |RFR002  |RFRACTION of b                             |       7|
 |        |Format: F6.4                               |        |
+|        |Measure: Scale                             |        |
+|        |Display Alignment: Right                   |        |
+|        |Display Width: 8                           |        |
 +--------+-------------------------------------------+--------+
 |Nb      |N of b                                     |       8|
 |        |Format: F6.0                               |        |
+|        |Measure: Scale                             |        |
+|        |Display Alignment: Right                   |        |
+|        |Display Width: 8                           |        |
 +--------+-------------------------------------------+--------+
        a        b  count        Ra        Rb RFR001 RFR002     Nb
 -------- -------- ------ --------- --------- ------ ------ ------
@@ -423,13 +455,25 @@ foo into RAN001(RANK of foo)
 |Variable|Description                                |Position|
 #========#===========================================#========#
 |foo     |Format: F8.2                               |       1|
+|        |Measure: Scale                             |        |
+|        |Display Alignment: Right                   |        |
+|        |Display Width: 8                           |        |
 +--------+-------------------------------------------+--------+
 |rfoo    |Format: F8.2                               |       2|
+|        |Measure: Scale                             |        |
+|        |Display Alignment: Right                   |        |
+|        |Display Width: 8                           |        |
 +--------+-------------------------------------------+--------+
 |ran003  |Format: F8.2                               |       3|
+|        |Measure: Scale                             |        |
+|        |Display Alignment: Right                   |        |
+|        |Display Width: 8                           |        |
 +--------+-------------------------------------------+--------+
 |RAN001  |RANK of foo                                |       4|
 |        |Format: F9.3                               |        |
+|        |Measure: Scale                             |        |
+|        |Display Alignment: Right                   |        |
+|        |Display Width: 8                           |        |
 +--------+-------------------------------------------+--------+
 Variables Created By RANK
 a into Sa(SAVAGE of a)
@@ -452,26 +496,29 @@ a into NOR001(NORMAL of a using BLOM)
 Variables Created By RANK
 a into Ra(RANK of a BY g2 g1)
 a into Na(NORMAL of a using RANKIT BY g2 g1)
-       a       g1       g2        Ra     Na
--------- -------- -------- --------- ------
-    1.00      .00     2.00     8.000 1.5341 
-    2.00      .00     2.00     7.000  .8871 
-    3.00      .00     2.00     6.000  .4888 
-    4.00      .00     2.00     5.000  .1573 
-    5.00      .00     2.00     4.000 -.1573 
-    6.00      .00     2.00     3.000 -.4888 
-    7.00      .00     2.00     2.000 -.8871 
-    8.00      .00     2.00     1.000 -1.534 
-    2.00     1.00     2.00     8.000  .9674 
-    2.00     1.00     2.00     8.000  .9674 
-    3.00     1.00     2.00     7.000  .5895 
-    4.00     1.00     2.00     6.000  .2822 
-    5.00     1.00     2.00     5.000  .0000 
-    6.00     1.00     2.00     4.000 -.2822 
-    7.00     1.00     2.00     2.000 -.9674 
-    7.00     1.00     2.00     2.000 -.9674 
-    8.00     1.00     2.00     1.000 -1.593 
-    9.00     1.00     1.00     1.000  .0000 
+Variables Created By RANK
+a into RAN001(RANK of a BY g2)
+a into NOR001(NORMAL of a using RANKIT BY g2)
+       a       g1       g2        Ra     Na    RAN001 NOR001 
+-------- -------- -------- --------- ------ --------- ------ 
+    2.00     1.00     2.00     8.000  .9674     4.000  .5244  
+    2.00     1.00     2.00     8.000  .9674     4.000  .5244  
+    3.00     1.00     2.00     7.000  .5895     3.000  .0000  
+    4.00     1.00     2.00     6.000  .2822     2.000 -.5244  
+    5.00     1.00     2.00     5.000  .0000     1.000 -1.282  
+    1.00      .00     2.00     8.000 1.5341     8.000 1.5341  
+    2.00      .00     2.00     7.000  .8871     7.000  .8871  
+    3.00      .00     2.00     6.000  .4888     6.000  .4888  
+    4.00      .00     2.00     5.000  .1573     5.000  .1573  
+    5.00      .00     2.00     4.000 -.1573     4.000 -.1573  
+    6.00      .00     2.00     3.000 -.4888     3.000 -.4888  
+    7.00      .00     2.00     2.000 -.8871     2.000 -.8871  
+    8.00      .00     2.00     1.000 -1.534     1.000 -1.534  
+    6.00     1.00     2.00     4.000 -.2822     4.000 1.1503  
+    7.00     1.00     2.00     2.000 -.9674     2.000 -.3186  
+    7.00     1.00     2.00     2.000 -.9674     2.000 -.3186  
+    8.00     1.00     2.00     1.000 -1.593     1.000 -1.150  
+    9.00     1.00     1.00     1.000  .0000     1.000  .0000  
 fractional ranks ( including small ones for special case of SAVAGE ranks)
 Variables Created By RANK
 a into Pa(PROPORTION of a using TUKEY)
@@ -526,7 +573,7 @@ END DATA.
 
 RANK x.
 
-MODIFY VARS /drop ran001 TO ran999.
+DELETE VAR ran001 TO ran999.
 
 LIST.
 
@@ -534,13 +581,20 @@ EOF
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="run program 4"
-$SUPERVISOR $PSPP --testing-mode -o raw-ascii -e /dev/null $TESTFILE 
+$SUPERVISOR $PSPP --testing-mode -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
+$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