more tests
[pspp] / tests / language / stats / ctables.at
index 0ab1b7c43937ee9b401890e4bd7143ce55ddf67c..ff60efa8df2ea8ec1bdc068a2719bc586506d617 100644 (file)
@@ -3,7 +3,6 @@ AT_BANNER([CTABLES])
 dnl Features not yet tested:
 dnl - Preprocessing to distinguish categorical from scale.
 dnl - Testing details of missing value handling in summaries.
-dnl - test CLABELS ROWLABELS=LAYER.
 dnl - Test VLABELS.
 dnl - Test WEIGHT and adjustment weights.
 dnl - Summary functions:
@@ -1573,10 +1572,31 @@ AT_SETUP([CTABLES CLABELS])
 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
 AT_DATA([ctables.sps],
 [[GET 'nhtsa.sav'.
+CTABLES /TABLE AgeGroup BY qns3a.
 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
+CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=LAYER.
+CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=LAYER.
 ]])
-AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
+pwd
+AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
+             Custom Tables
+╭───────────────────────┬────────────╮
+│                       │S3a. GENDER:│
+│                       ├─────┬──────┤
+│                       │ Male│Female│
+│                       ├─────┼──────┤
+│                       │Count│ Count│
+├───────────────────────┼─────┼──────┤
+│Age group 15 or younger│    0│     0│
+│          16 to 25     │  594│   505│
+│          26 to 35     │  476│   491│
+│          36 to 45     │  489│   548│
+│          46 to 55     │  526│   649│
+│          56 to 65     │  516│   731│
+│          66 or older  │  531│   943│
+╰───────────────────────┴─────┴──────╯
+
                                                       Custom Tables
 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
 │       │                                                 S3a. GENDER:                                                 │
@@ -1619,6 +1639,122 @@ AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
 │          66 or older   Male  │         531│
 │                        Female│         943│
 ╰──────────────────────────────┴────────────╯
+
+      Custom Tables
+15 or younger
+╭─────────┬────────────╮
+│         │S3a. GENDER:│
+│         ├─────┬──────┤
+│         │ Male│Female│
+│         ├─────┼──────┤
+│         │Count│ Count│
+├─────────┼─────┼──────┤
+│Age group│    0│     0│
+╰─────────┴─────┴──────╯
+
+      Custom Tables
+16 to 25
+╭─────────┬────────────╮
+│         │S3a. GENDER:│
+│         ├─────┬──────┤
+│         │ Male│Female│
+│         ├─────┼──────┤
+│         │Count│ Count│
+├─────────┼─────┼──────┤
+│Age group│  594│   505│
+╰─────────┴─────┴──────╯
+
+      Custom Tables
+26 to 35
+╭─────────┬────────────╮
+│         │S3a. GENDER:│
+│         ├─────┬──────┤
+│         │ Male│Female│
+│         ├─────┼──────┤
+│         │Count│ Count│
+├─────────┼─────┼──────┤
+│Age group│  476│   491│
+╰─────────┴─────┴──────╯
+
+      Custom Tables
+36 to 45
+╭─────────┬────────────╮
+│         │S3a. GENDER:│
+│         ├─────┬──────┤
+│         │ Male│Female│
+│         ├─────┼──────┤
+│         │Count│ Count│
+├─────────┼─────┼──────┤
+│Age group│  489│   548│
+╰─────────┴─────┴──────╯
+
+      Custom Tables
+46 to 55
+╭─────────┬────────────╮
+│         │S3a. GENDER:│
+│         ├─────┬──────┤
+│         │ Male│Female│
+│         ├─────┼──────┤
+│         │Count│ Count│
+├─────────┼─────┼──────┤
+│Age group│  526│   649│
+╰─────────┴─────┴──────╯
+
+      Custom Tables
+56 to 65
+╭─────────┬────────────╮
+│         │S3a. GENDER:│
+│         ├─────┬──────┤
+│         │ Male│Female│
+│         ├─────┼──────┤
+│         │Count│ Count│
+├─────────┼─────┼──────┤
+│Age group│  516│   731│
+╰─────────┴─────┴──────╯
+
+      Custom Tables
+66 or older
+╭─────────┬────────────╮
+│         │S3a. GENDER:│
+│         ├─────┬──────┤
+│         │ Male│Female│
+│         ├─────┼──────┤
+│         │Count│ Count│
+├─────────┼─────┼──────┤
+│Age group│  531│   943│
+╰─────────┴─────┴──────╯
+
+             Custom Tables
+Male
+╭───────────────────────┬────────────╮
+│                       │S3a. GENDER:│
+│                       ├────────────┤
+│                       │    Count   │
+├───────────────────────┼────────────┤
+│Age group 15 or younger│           0│
+│          16 to 25     │         594│
+│          26 to 35     │         476│
+│          36 to 45     │         489│
+│          46 to 55     │         526│
+│          56 to 65     │         516│
+│          66 or older  │         531│
+╰───────────────────────┴────────────╯
+
+             Custom Tables
+Female
+╭───────────────────────┬────────────╮
+│                       │S3a. GENDER:│
+│                       ├────────────┤
+│                       │    Count   │
+├───────────────────────┼────────────┤
+│Age group 15 or younger│           0│
+│          16 to 25     │         505│
+│          26 to 35     │         491│
+│          36 to 45     │         548│
+│          46 to 55     │         649│
+│          56 to 65     │         731│
+│          66 or older  │         943│
+╰───────────────────────┴────────────╯
 ])
 AT_CLEANUP