CTABLES split file
[pspp] / tests / language / stats / ctables.at
index 12caa73d3b3c0b57bacb64900f091c950e88224a..4bdd1744ff72901981e824a10f45499c12de1396 100644 (file)
@@ -10,7 +10,6 @@ dnl   * )CILEVEL in summary label specification
 dnl - Summary functions:
 dnl   * U-prefix for unweighted summaries.
 dnl   * areaPCT.SUM and UareaPCT.SUM functions.
-dnl - SPLIT FILE with SEPARATE splits
 dnl - Definition of columns/rows when labels are rotated from one axis to another.
 dnl
 dnl Not for v1:
@@ -3255,7 +3254,6 @@ AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
 ])
 AT_CLEANUP
 
-
 AT_SETUP([CTABLES scale summary functions])
 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
 AT_DATA([ctables.sps],
@@ -3535,3 +3533,118 @@ AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
 ])
 AT_CLEANUP
 
+AT_SETUP([CTABLES with SPLIT FILE])
+AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
+AT_DATA([ctables.sps],
+[[GET 'nhtsa.sav'.
+
+SORT CASES BY qns3a.
+
+CTABLES /TABLE qn105ba.
+
+* Layered split has no effect on output.
+SPLIT FILE BY qns3a.
+CTABLES /TABLE qn105ba.
+
+* Add column variable qns3a to compare against separate splits.
+CTABLES /TABLE qn105ba BY qns3a.
+
+* Separate splits are truly output separately.
+SPLIT FILE SEPARATE BY qns3a.
+CTABLES /TABLE qn105ba.
+]])
+AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
+                                  Custom Tables
+╭────────────────────────────────────────────────────────────────────────┬─────╮
+│                                                                        │Count│
+├────────────────────────────────────────────────────────────────────────┼─────┤
+│105b. How likely is it that drivers who have had too much   Almost      │  700│
+│to drink to drive safely will A. Get stopped by the police? certain     │     │
+│                                                            Very likely │ 1502│
+│                                                            Somewhat    │ 2763│
+│                                                            likely      │     │
+│                                                            Somewhat    │ 1307│
+│                                                            unlikely    │     │
+│                                                            Very        │  609│
+│                                                            unlikely    │     │
+╰────────────────────────────────────────────────────────────────────────┴─────╯
+
+                                  Custom Tables
+╭────────────────────────────────────────────────────────────────────────┬─────╮
+│                                                                        │Count│
+├────────────────────────────────────────────────────────────────────────┼─────┤
+│105b. How likely is it that drivers who have had too much   Almost      │  700│
+│to drink to drive safely will A. Get stopped by the police? certain     │     │
+│                                                            Very likely │ 1502│
+│                                                            Somewhat    │ 2763│
+│                                                            likely      │     │
+│                                                            Somewhat    │ 1307│
+│                                                            unlikely    │     │
+│                                                            Very        │  609│
+│                                                            unlikely    │     │
+╰────────────────────────────────────────────────────────────────────────┴─────╯
+
+                                  Custom Tables
+╭─────────────────────────────────────────────────────────────────┬────────────╮
+│                                                                 │S3a. GENDER:│
+│                                                                 ├─────┬──────┤
+│                                                                 │ Male│Female│
+│                                                                 ├─────┼──────┤
+│                                                                 │Count│ Count│
+├─────────────────────────────────────────────────────────────────┼─────┼──────┤
+│105b. How likely is it that drivers who have had too Almost      │  297│   403│
+│much to drink to drive safely will A. Get stopped by certain     │     │      │
+│the police?                                          Very likely │  660│   842│
+│                                                     Somewhat    │ 1174│  1589│
+│                                                     likely      │     │      │
+│                                                     Somewhat    │  640│   667│
+│                                                     unlikely    │     │      │
+│                                                     Very        │  311│   298│
+│                                                     unlikely    │     │      │
+╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
+
+    Split Values
+╭────────────┬─────╮
+│Variable    │Value│
+├────────────┼─────┤
+│S3a. GENDER:│Male │
+╰────────────┴─────╯
+
+                                  Custom Tables
+╭────────────────────────────────────────────────────────────────────────┬─────╮
+│                                                                        │Count│
+├────────────────────────────────────────────────────────────────────────┼─────┤
+│105b. How likely is it that drivers who have had too much   Almost      │  297│
+│to drink to drive safely will A. Get stopped by the police? certain     │     │
+│                                                            Very likely │  660│
+│                                                            Somewhat    │ 1174│
+│                                                            likely      │     │
+│                                                            Somewhat    │  640│
+│                                                            unlikely    │     │
+│                                                            Very        │  311│
+│                                                            unlikely    │     │
+╰────────────────────────────────────────────────────────────────────────┴─────╯
+
+     Split Values
+╭────────────┬──────╮
+│Variable    │ Value│
+├────────────┼──────┤
+│S3a. GENDER:│Female│
+╰────────────┴──────╯
+
+                                  Custom Tables
+╭────────────────────────────────────────────────────────────────────────┬─────╮
+│                                                                        │Count│
+├────────────────────────────────────────────────────────────────────────┼─────┤
+│105b. How likely is it that drivers who have had too much   Almost      │  403│
+│to drink to drive safely will A. Get stopped by the police? certain     │     │
+│                                                            Very likely │  842│
+│                                                            Somewhat    │ 1589│
+│                                                            likely      │     │
+│                                                            Somewhat    │  667│
+│                                                            unlikely    │     │
+│                                                            Very        │  298│
+│                                                            unlikely    │     │
+╰────────────────────────────────────────────────────────────────────────┴─────╯
+])
+AT_CLEANUP