test vlabels
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 4 Aug 2022 23:01:18 +0000 (16:01 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 4 Aug 2022 23:01:18 +0000 (16:01 -0700)
tests/language/stats/ctables.at

index ff60efa8df2ea8ec1bdc068a2719bc586506d617..ef606146dce81f2f612c21769c4b12db74764d33 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 VLABELS.
 dnl - Test WEIGHT and adjustment weights.
 dnl - Summary functions:
 dnl   * Separate summary functions for totals and subtotals.
@@ -2073,3 +2072,109 @@ AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
 ╰────────┴─────╯
 ])
 AT_CLEANUP
+
+AT_SETUP([CTABLES VLABELS])
+AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
+AT_DATA([ctables.sps],
+[[GET 'nhtsa.sav'.
+CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=DEFAULT /TABLE qnd5a BY qns3a.
+CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NAME    /TABLE qnd5a BY qns3a.
+CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=LABEL   /TABLE qnd5a BY qns3a.
+CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=BOTH    /TABLE qnd5a BY qns3a.
+CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE    /TABLE qnd5a BY qns3a.
+]])
+AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
+                                 Custom Tables
+╭────────────────────────────────────────────────────────────────┬────────────╮
+│                                                                │S3a. GENDER:│
+│                                                                ├─────┬──────┤
+│                                                                │ Male│Female│
+│                                                                ├─────┼──────┤
+│                                                                │Count│ Count│
+├────────────────────────────────────────────────────────────────┼─────┼──────┤
+│D5a. What would you say is your primary    Cuban                │   13│     7│
+│ethnic background?                         Mexican              │  175│   136│
+│                                           Spanish              │   20│    28│
+│                                           South American       │   21│    13│
+│                                           Central American     │   27│    25│
+│                                           Puerto Rican, OR     │   37│    41│
+│                                           Something else       │   35│    33│
+│                                           Multiple - cannot    │    2│     5│
+│                                           choose one           │     │      │
+╰────────────────────────────────────────────────────────────────┴─────┴──────╯
+
+                  Custom Tables
+╭──────────────────────────────────┬────────────╮
+│                                  │    QNS3A   │
+│                                  ├─────┬──────┤
+│                                  │ Male│Female│
+│                                  ├─────┼──────┤
+│                                  │Count│ Count│
+├──────────────────────────────────┼─────┼──────┤
+│QND5A Cuban                       │   13│     7│
+│      Mexican                     │  175│   136│
+│      Spanish                     │   20│    28│
+│      South American              │   21│    13│
+│      Central American            │   27│    25│
+│      Puerto Rican, OR            │   37│    41│
+│      Something else              │   35│    33│
+│      Multiple - cannot choose one│    2│     5│
+╰──────────────────────────────────┴─────┴──────╯
+
+                                 Custom Tables
+╭────────────────────────────────────────────────────────────────┬────────────╮
+│                                                                │S3a. GENDER:│
+│                                                                ├─────┬──────┤
+│                                                                │ Male│Female│
+│                                                                ├─────┼──────┤
+│                                                                │Count│ Count│
+├────────────────────────────────────────────────────────────────┼─────┼──────┤
+│D5a. What would you say is your primary    Cuban                │   13│     7│
+│ethnic background?                         Mexican              │  175│   136│
+│                                           Spanish              │   20│    28│
+│                                           South American       │   21│    13│
+│                                           Central American     │   27│    25│
+│                                           Puerto Rican, OR     │   37│    41│
+│                                           Something else       │   35│    33│
+│                                           Multiple - cannot    │    2│     5│
+│                                           choose one           │     │      │
+╰────────────────────────────────────────────────────────────────┴─────┴──────╯
+
+                                 Custom Tables
+╭────────────────────────────────────────────────────────────┬────────────────╮
+│                                                            │   QNS3A S3a.   │
+│                                                            │     GENDER:    │
+│                                                            ├───────┬────────┤
+│                                                            │  Male │ Female │
+│                                                            ├───────┼────────┤
+│                                                            │ Count │  Count │
+├────────────────────────────────────────────────────────────┼───────┼────────┤
+│QND5A D5a. What would you say is your    Cuban              │     13│       7│
+│primary ethnic background?               Mexican            │    175│     136│
+│                                         Spanish            │     20│      28│
+│                                         South American     │     21│      13│
+│                                         Central American   │     27│      25│
+│                                         Puerto Rican, OR   │     37│      41│
+│                                         Something else     │     35│      33│
+│                                         Multiple - cannot  │      2│       5│
+│                                         choose one         │       │        │
+╰────────────────────────────────────────────────────────────┴───────┴────────╯
+
+               Custom Tables
+╭────────────────────────────┬─────┬──────╮
+│                            │ Male│Female│
+│                            ├─────┼──────┤
+│                            │Count│ Count│
+├────────────────────────────┼─────┼──────┤
+│Cuban                       │   13│     7│
+│Mexican                     │  175│   136│
+│Spanish                     │   20│    28│
+│South American              │   21│    13│
+│Central American            │   27│    25│
+│Puerto Rican, OR            │   37│    41│
+│Something else              │   35│    33│
+│Multiple - cannot choose one│    2│     5│
+╰────────────────────────────┴─────┴──────╯
+])
+AT_CLEANUP
+