A few basic tests pass.
[pspp] / tests / language / stats / ctables.at
index 72aac4bf850cda12edb10066ba1fb9b8e848e5c7..e8b5981b101e704dba609e51030b189465fdffe7 100644 (file)
@@ -11,4 +11,82 @@ CTABLES /TABLE=x[c] [ROWPCT.COUNT] > y[c].
 CTABLES /TABLE=x[c] > y[c] [ROWPCT.COUNT].
 ]])
 AT_CHECK([pspp ctables.sps])
-AT_CLEANUP
\ No newline at end of file
+AT_CLEANUP
+
+AT_SETUP([CTABLES one categorical variable])
+AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
+AT_DATA([ctables.sps],
+[[GET 'nhtsa.sav'.
+CTABLES /TABLE QN1.
+CTABLES /TABLE BY QN1.
+CTABLES /TABLE BY BY QN1.
+]])
+AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
+                                  Custom Tables
+╭────────────────────────────────────────────────────────────────────────┬─────╮
+│                                                                        │Count│
+├────────────────────────────────────────────────────────────────────────┼─────┤
+│ 1. How often do you usually drive a car or other  Every day            │ 4667│
+│motor vehicle?                                     Several days a week  │ 1274│
+│                                                   Once a week or less  │  361│
+│                                                   Only certain times a │  130│
+│                                                   year                 │     │
+│                                                   Never                │  540│
+╰────────────────────────────────────────────────────────────────────────┴─────╯
+
+                                  Custom Tables
+╭──────────────────────────────────────────────────────────────────────────────╮
+│        1. How often do you usually drive a car or other motor vehicle?       │
+├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
+│         │  Several days a  │  Once a week or  │  Only certain times a  │     │
+│Every day│       week       │       less       │          year          │Never│
+├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
+│  Count  │       Count      │       Count      │          Count         │Count│
+├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
+│     4667│              1274│               361│                     130│  540│
+╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
+
+Custom Tables
+Every day
+╭─────╮
+│Count│
+├─────┤
+│ 4667│
+╰─────╯
+])
+AT_CLEANUP
+
+AT_SETUP([CTABLES one scale variable])
+AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
+AT_DATA([ctables.sps],
+[[GET 'nhtsa.sav'.
+CTABLES /TABLE QND1[COUNT, MEAN, STDDEV, MINIMUM, MAXIMUM].
+CTABLES /TABLE BY QND1.
+CTABLES /TABLE BY BY QND1.
+]])
+AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
+                            Custom Tables
+╭──────────────────────────┬─────┬────┬─────────────┬───────┬───────╮
+│                          │Count│Mean│Std Deviation│Minimum│Maximum│
+├──────────────────────────┼─────┼────┼─────────────┼───────┼───────┤
+│D1. AGE: What is your age?│ 6930│  48│           19│     16│     86│
+╰──────────────────────────┴─────┴────┴─────────────┴───────┴───────╯
+
+        Custom Tables
+╭──────────────────────────╮
+│D1. AGE: What is your age?│
+├──────────────────────────┤
+│           Mean           │
+├──────────────────────────┤
+│                        48│
+╰──────────────────────────╯
+
+Custom Tables
+D1. AGE: What is your age?
+╭────╮
+│Mean│
+├────┤
+│  48│
+╰────╯
+])
+AT_CLEANUP