FORMAT=EMPTY
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 4 Aug 2022 23:11:52 +0000 (16:11 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 4 Aug 2022 23:11:52 +0000 (16:11 -0700)
tests/language/stats/ctables.at

index ef606146dce81f2f612c21769c4b12db74764d33..cfa39ec3a3503af7888eb0db6cacfed9c047e6e3 100644 (file)
@@ -17,7 +17,6 @@ dnl   * THRU (numeric ranges)
 dnl   * OTHERNM
 dnl - FORMAT:
 dnl   * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
-dnl   * EMPTY.
 dnl   * MISSING.
 dnl - HIDESMALLCOUNTS.
 dnl - Date/time variables and values
@@ -2178,3 +2177,80 @@ AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
 ])
 AT_CLEANUP
 
+AT_SETUP([CTABLES FORMAT=EMPTY])
+AT_KEYWORDS([FORMAT EMPTY])
+AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
+AT_DATA([ctables.sps],
+[[GET 'nhtsa.sav'.
+CTABLES /FORMAT EMPTY=ZERO /TABLE qnd5a BY qnd5.
+CTABLES /FORMAT EMPTY=BLANK /TABLE qnd5a BY qnd5.
+CTABLES /FORMAT EMPTY='n/a' /TABLE qnd5a BY qnd5.
+]])
+AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
+                                 Custom Tables
+╭─────────────────────────────────────────────┬───────────────────────────────╮
+│                                             │   D5. ETHNICITY: Are you of   │
+│                                             │  Hispanic or Latino origin or │
+│                                             │            descent?           │
+│                                             ├───────────────┬───────────────┤
+│                                             │      Yes      │       No      │
+│                                             ├───────────────┼───────────────┤
+│                                             │     Count     │     Count     │
+├─────────────────────────────────────────────┼───────────────┼───────────────┤
+│D5a. What would you say is   Cuban           │             20│              0│
+│your primary ethnic          Mexican         │            311│              0│
+│background?                  Spanish         │             48│              0│
+│                             South American  │             34│              0│
+│                             Central American│             52│              0│
+│                             Puerto Rican, OR│             78│              0│
+│                             Something else  │             68│              0│
+│                             Multiple -      │              7│              0│
+│                             cannot choose   │               │               │
+│                             one             │               │               │
+╰─────────────────────────────────────────────┴───────────────┴───────────────╯
+
+                                 Custom Tables
+╭─────────────────────────────────────────────┬───────────────────────────────╮
+│                                             │   D5. ETHNICITY: Are you of   │
+│                                             │  Hispanic or Latino origin or │
+│                                             │            descent?           │
+│                                             ├───────────────┬───────────────┤
+│                                             │      Yes      │       No      │
+│                                             ├───────────────┼───────────────┤
+│                                             │     Count     │     Count     │
+├─────────────────────────────────────────────┼───────────────┼───────────────┤
+│D5a. What would you say is   Cuban           │             20│               │
+│your primary ethnic          Mexican         │            311│               │
+│background?                  Spanish         │             48│               │
+│                             South American  │             34│               │
+│                             Central American│             52│               │
+│                             Puerto Rican, OR│             78│               │
+│                             Something else  │             68│               │
+│                             Multiple -      │              7│               │
+│                             cannot choose   │               │               │
+│                             one             │               │               │
+╰─────────────────────────────────────────────┴───────────────┴───────────────╯
+
+                                 Custom Tables
+╭─────────────────────────────────────────────┬───────────────────────────────╮
+│                                             │   D5. ETHNICITY: Are you of   │
+│                                             │  Hispanic or Latino origin or │
+│                                             │            descent?           │
+│                                             ├───────────────┬───────────────┤
+│                                             │      Yes      │       No      │
+│                                             ├───────────────┼───────────────┤
+│                                             │     Count     │     Count     │
+├─────────────────────────────────────────────┼───────────────┼───────────────┤
+│D5a. What would you say is   Cuban           │             20│n/a            │
+│your primary ethnic          Mexican         │            311│n/a            │
+│background?                  Spanish         │             48│n/a            │
+│                             South American  │             34│n/a            │
+│                             Central American│             52│n/a            │
+│                             Puerto Rican, OR│             78│n/a            │
+│                             Something else  │             68│n/a            │
+│                             Multiple -      │              7│n/a            │
+│                             cannot choose   │               │               │
+│                             one             │               │               │
+╰─────────────────────────────────────────────┴───────────────┴───────────────╯
+])
+AT_CLEANUP
\ No newline at end of file