titles
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 5 Aug 2022 01:26:45 +0000 (18:26 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 5 Aug 2022 01:26:45 +0000 (18:26 -0700)
tests/language/stats/ctables.at

index 4b520cc0cddd540a19ebeb8bfbb4660970772469..0eb8760a585a1ce2ed893c7974e8e8be49ac408e 100644 (file)
@@ -12,7 +12,6 @@ dnl   * Date values
 dnl   * THRU (numeric ranges)
 dnl   * OTHERNM
 dnl - Date/time variables and values
-dnl - TITLES: )DATE, )TIME, )TABLE.
 dnl - Test PCOMPUTE:
 dnl   * PCOMPUTE for more than one kind of summary (e.g. [COUNT, ROWPCT]).
 dnl   * MISSING, OTHERNM
@@ -2492,3 +2491,41 @@ AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
 ╰─┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────╯
 ])
 AT_CLEANUP
+
+AT_SETUP([CTABLES TITLES])
+AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
+AT_DATA([ctables.sps],
+[[GET 'nhtsa.sav'.
+CTABLES
+    /VLABELS VARIABLES=qn1 DISPLAY=NONE
+    /TABLE ((qn1[c][COUNT])) BY qns3a[c] > qnd5
+    /TITLES TITLE='How often do you drive?'
+            CAPTION='Generated )TIME on )DATE'
+           CORNER=')TABLE'.
+]])
+AT_CHECK([pspp ctables.sps -O box=unicode | sed 's/..:..:../HH:MM:SS/
+s&../../..&MM/DD/YY&'], [0], [dnl
+                            How often do you drive?
+╭───────────────────────────────────┬─────────────────────────────────────────╮
+│                                   │               S3a. GENDER:              │
+│                                   ├────────────────────┬────────────────────┤
+│                                   │        Male        │       Female       │
+│                                   ├────────────────────┼────────────────────┤
+│                                   │ D5. ETHNICITY: Are │ D5. ETHNICITY: Are │
+│                                   │ you of Hispanic or │ you of Hispanic or │
+│                                   │  Latino origin or  │  Latino origin or  │
+│( ( 1. How often do you usually    │      descent?      │      descent?      │
+│drive a car or other motor         ├─────────┬──────────┼─────────┬──────────┤
+│vehicle?) ) BY S3a. GENDER: > D5.  │   Yes   │    No    │   Yes   │    No    │
+│ETHNICITY: Are you of Hispanic or  ├─────────┼──────────┼─────────┼──────────┤
+│Latino origin or descent?          │  Count  │   Count  │  Count  │   Count  │
+├───────────────────────────────────┼─────────┼──────────┼─────────┼──────────┤
+│Every day                          │      218│      2066│      166│      2175│
+│Several days a week                │       44│       391│       45│       782│
+│Once a week or less                │       16│       109│       12│       223│
+│Only certain times a year          │       15│        41│       11│        61│
+│Never                              │       39│       150│       56│       278│
+╰───────────────────────────────────┴─────────┴──────────┴─────────┴──────────╯
+Generated HH:MM:SS on MM/DD/YY
+])
+AT_CLEANUP