Rewrite PSPP output engine.
[pspp-builds.git] / tests / command / get-data-gnm.sh
index c28c8dd478c9f6dc4dd04ea8ddd5dbb2ac27a069..cf4e6ca8ec9e9a4d4e4368c3c0179220a4a0d1bb 100755 (executable)
@@ -92,120 +92,94 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="compare output 1"
-diff $TEMPDIR/pspp.list - <<EOF
-1.1 DISPLAY.  
-+--------+-------------------------------------------+--------+
-|Variable|Description                                |Position|
-#========#===========================================#========#
-|VAR001  |Format: F8.2                               |       1|
-|        |Measure: Scale                             |        |
-|        |Display Alignment: Right                   |        |
-|        |Display Width: 8                           |        |
-+--------+-------------------------------------------+--------+
-|VAR002  |Format: A8                                 |       2|
-|        |Measure: Nominal                           |        |
-|        |Display Alignment: Left                    |        |
-|        |Display Width: 8                           |        |
-+--------+-------------------------------------------+--------+
-|VAR003  |Format: F8.2                               |       3|
-|        |Measure: Scale                             |        |
-|        |Display Alignment: Right                   |        |
-|        |Display Width: 8                           |        |
-+--------+-------------------------------------------+--------+
-
-  VAR001   VAR002   VAR003
--------- -------- --------
-     .00 fred        20.00 
-    1.00 11          21.00 
-    2.00 twelve      22.00 
-    3.00 13          23.00 
-    4.00 14          24.00 
-
-2.1 DISPLAY.  
-+--------+-------------------------------------------+--------+
-|Variable|Description                                |Position|
-#========#===========================================#========#
-|V1      |Format: F8.2                               |       1|
-|        |Measure: Scale                             |        |
-|        |Display Alignment: Right                   |        |
-|        |Display Width: 8                           |        |
-+--------+-------------------------------------------+--------+
-|V2      |Format: A8                                 |       2|
-|        |Measure: Nominal                           |        |
-|        |Display Alignment: Left                    |        |
-|        |Display Width: 8                           |        |
-+--------+-------------------------------------------+--------+
-|VAR001  |Format: F8.2                               |       3|
-|        |Measure: Scale                             |        |
-|        |Display Alignment: Right                   |        |
-|        |Display Width: 8                           |        |
-+--------+-------------------------------------------+--------+
-
-      V1       V2   VAR001
--------- -------- --------
-     .00 fred        20.00 
-    1.00 11          21.00 
-    2.00 twelve      22.00 
-    3.00 13          23.00 
-    4.00 14          24.00 
-
-3.1 DISPLAY.  
-+--------+-------------------------------------------+--------+
-|Variable|Description                                |Position|
-#========#===========================================#========#
-|name    |Format: A8                                 |       1|
-|        |Measure: Nominal                           |        |
-|        |Display Alignment: Left                    |        |
-|        |Display Width: 8                           |        |
-+--------+-------------------------------------------+--------+
-|id      |Format: F8.2                               |       2|
-|        |Measure: Scale                             |        |
-|        |Display Alignment: Right                   |        |
-|        |Display Width: 8                           |        |
-+--------+-------------------------------------------+--------+
-|height  |Format: F8.2                               |       3|
-|        |Measure: Scale                             |        |
-|        |Display Alignment: Right                   |        |
-|        |Display Width: 8                           |        |
-+--------+-------------------------------------------+--------+
-
-    name       id   height
--------- -------- --------
-fred          .00    23.40 
-bert         1.00      .56 
-charlie      2.00      .   
-dick         3.00   -34.09 
-
-4.1 DISPLAY.  
-+--------+-------------------------------------------+--------+
-|Variable|Description                                |Position|
-#========#===========================================#========#
-|vone    |Format: F8.2                               |       1|
-|        |Measure: Scale                             |        |
-|        |Display Alignment: Right                   |        |
-|        |Display Width: 8                           |        |
-+--------+-------------------------------------------+--------+
-|vtwo    |Format: F8.2                               |       2|
-|        |Measure: Scale                             |        |
-|        |Display Alignment: Right                   |        |
-|        |Display Width: 8                           |        |
-+--------+-------------------------------------------+--------+
-|vthree  |Format: A8                                 |       3|
-|        |Measure: Nominal                           |        |
-|        |Display Alignment: Left                    |        |
-|        |Display Width: 8                           |        |
-+--------+-------------------------------------------+--------+
-|v4      |Format: F8.2                               |       4|
-|        |Measure: Scale                             |        |
-|        |Display Alignment: Right                   |        |
-|        |Display Width: 8                           |        |
-+--------+-------------------------------------------+--------+
-
-    vone     vtwo   vthree       v4
--------- -------- -------- --------
-    1.00     3.00              5.00 
-    2.00     4.00              6.00 
-
+diff -c $TEMPDIR/pspp.csv - <<EOF
+Variable,Description,,Position
+VAR001,Format: F8.2,,1
+,Measure: Scale,,
+,Display Alignment: Right,,
+,Display Width: 8,,
+VAR002,Format: A8,,2
+,Measure: Nominal,,
+,Display Alignment: Left,,
+,Display Width: 8,,
+VAR003,Format: F8.2,,3
+,Measure: Scale,,
+,Display Alignment: Right,,
+,Display Width: 8,,
+
+Table: Data List
+VAR001,VAR002,VAR003
+.00,fred    ,20.00
+1.00,11      ,21.00
+2.00,twelve  ,22.00
+3.00,13      ,23.00
+4.00,14      ,24.00
+
+Variable,Description,,Position
+V1,Format: F8.2,,1
+,Measure: Scale,,
+,Display Alignment: Right,,
+,Display Width: 8,,
+V2,Format: A8,,2
+,Measure: Nominal,,
+,Display Alignment: Left,,
+,Display Width: 8,,
+VAR001,Format: F8.2,,3
+,Measure: Scale,,
+,Display Alignment: Right,,
+,Display Width: 8,,
+
+Table: Data List
+V1,V2,VAR001
+.00,fred    ,20.00
+1.00,11      ,21.00
+2.00,twelve  ,22.00
+3.00,13      ,23.00
+4.00,14      ,24.00
+
+Variable,Description,,Position
+name,Format: A8,,1
+,Measure: Nominal,,
+,Display Alignment: Left,,
+,Display Width: 8,,
+id,Format: F8.2,,2
+,Measure: Scale,,
+,Display Alignment: Right,,
+,Display Width: 8,,
+height,Format: F8.2,,3
+,Measure: Scale,,
+,Display Alignment: Right,,
+,Display Width: 8,,
+
+Table: Data List
+name,id,height
+fred    ,.00,23.40
+bert    ,1.00,.56
+charlie ,2.00,.  
+dick    ,3.00,-34.09
+
+Variable,Description,,Position
+vone,Format: F8.2,,1
+,Measure: Scale,,
+,Display Alignment: Right,,
+,Display Width: 8,,
+vtwo,Format: F8.2,,2
+,Measure: Scale,,
+,Display Alignment: Right,,
+,Display Width: 8,,
+vthree,Format: A8,,3
+,Measure: Nominal,,
+,Display Alignment: Left,,
+,Display Width: 8,,
+v4,Format: F8.2,,4
+,Measure: Scale,,
+,Display Alignment: Right,,
+,Display Width: 8,,
+
+Table: Data List
+vone,vtwo,vthree,v4
+1.00,3.00,,5.00
+2.00,4.00,,6.00
 EOF
 if [ $? -ne 0 ] ; then fail ; fi
 
@@ -227,10 +201,10 @@ $SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE > /dev/null
 if [ $? -ne 0 ] ; then fail ; fi
 
 activity="compare output 2"
-diff $TEMPDIR/pspp.list - <<EOF
-warning: Selected sheet or range of spreadsheet "$TEMPDIR/Book1.gnumeric" is empty.
-warning: Selected sheet or range of spreadsheet "$TEMPDIR/Book1.gnumeric" is empty.
+diff -c $TEMPDIR/pspp.csv - <<EOF
+"warning: Selected sheet or range of spreadsheet ""$TEMPDIR/Book1.gnumeric"" is empty."
 
+"warning: Selected sheet or range of spreadsheet ""$TEMPDIR/Book1.gnumeric"" is empty."
 EOF
 if [ $? -ne 0 ] ; then fail ; fi