CTABLES missing values start to make some minimal amount of sense
[pspp] / tests / language / stats / ctables.at
index 1b7021438e98fba13e2e23acdb1c58cceb220183..8f038da121ca43f5cb1ceef6fa8afd570f0bc861 100644 (file)
@@ -978,17 +978,33 @@ BEGIN DATA.
 . 3
 . 4
 . 5
+. .
 END DATA.
 MISSING VALUES x (1, 2) y (2, 3).
 VARIABLE LEVEL ALL (NOMINAL).
 
-CTABLES /TABLE x[COUNT,TOTALS[COUNT, VALIDN, TOTALN]]
+*TABLES /TABLE x[COUNT, TOTALS[COUNT, VALIDN, TOTALN]]
     /CATEGORIES VARIABLES=ALL TOTAL=YES.
-CTABLES /TABLE x[COUNT,TOTALS[COUNT, VALIDN, TOTALN]]
+CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
     /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
-CTABLES /TABLE x BY y.
-CTABLES /TABLE x BY y /CATEGORIES VARIABLES=ALL MISSING=INCLUDE.
-CTABLES /TABLE y BY x /CATEGORIES VARIABLES=ALL MISSING=INCLUDE.
+*CTABLES /TABLE x BY y.
+*CTABLES /TABLE x BY y /CATEGORIES VARIABLES=ALL MISSING=INCLUDE.
+*CTABLES /TABLE y BY x /CATEGORIES VARIABLES=ALL MISSING=INCLUDE.
 ]])
-AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [])
+AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
+                               Custom Tables
+╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
+│       │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
+├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
+│x 1.00 │    6│   20.0%│             .0%│           16.7%│       │       │
+│  2.00 │    6│   20.0%│             .0%│           16.7%│       │       │
+│  3.00 │    6│   20.0%│           33.3%│           16.7%│       │       │
+│  4.00 │    6│   20.0%│           33.3%│           16.7%│       │       │
+│  5.00 │    6│   20.0%│           33.3%│           16.7%│       │       │
+│  Total│   30│  100.0%│          100.0%│          100.0%│     18│     36│
+╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
+dnl Note that the Total N % doesn't add up to 100 because system-missing
+dnl values are included in the total but not shown as a category and this
+dnl is expected behavior.
+])
 AT_CLEANUP
\ No newline at end of file