1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
17 AT_BANNER([SPLIT FILE])
19 AT_SETUP([SPLIT FILE - basic test])
20 AT_DATA([split-file.sps], [dnl
21 title 'Test SPLIT FILE utility'.
23 data list notable /X 1 Y 2.
42 AT_CHECK([pspp -o pspp.csv split-file.sps])
43 AT_CHECK([cat pspp.csv], [0], [dnl
73 AT_SETUP([SPLIT FILE - vs procedures])
74 AT_DATA([split-file.sps], [dnl
76 * This test is a compendium of those procedures which might
77 * have problems when run in conjunction with SPLITS.
79 data list list /a b c q g *.
91 * The commented out lines are ones which currently fail.
93 AGGREGATE outfile='foo' /break=c /X=sum(a).
94 AUTORECODE variables = c into d .
95 COUNT e = c (1 2 3 4 5 6 7).
97 CORRELATIONS /VARIABLES = a b.
101 EXPORT outfile='xxx'.
102 FACTOR /VARIABLES = b c d.
106 GRAPH /HISTOGRAM = b .
107 GRAPH /SCATTERPLOT(BIVARIATE) = b with c by e .
108 *GRAPH /BAR (GROUPED) = MEAN(b) by c by e.
109 GRAPH /BAR = COUNT BY b.
111 LOGISTIC REGRESSION q WITH b.
113 NPAR TESTS /MCNEMAR q.
117 REGRESSION /VARIABLES = c /DEPENDENT = q.
118 RELIABILITY /VARIABLES = c b d.
119 RENAME VARIABLES (b = bb).
122 SAVE outfile='xx.sav'.
124 T-TEST /GROUP=q(0,1) /VARIABLES=bb.
126 FLIP /VARIABLES = bb, c .
132 AT_CHECK([pspp -O format=csv split-file.sps], [0],[ignore])
136 AT_SETUP([SPLIT FILE - split variable limit])
137 AT_DATA([split-file.sps], [dnl
138 DATA LIST LIST NOTABLE /V1 TO V9.
139 SPLIT FILE BY V1 TO V9.
141 AT_CHECK([pspp split-file.sps], [1], [dnl
142 split-file.sps:2.15-2.22: error: SPLIT FILE: At most 8 split variables may be
144 2 | SPLIT FILE BY V1 TO V9.
149 AT_SETUP([SPLIT FILE - SHOW SPLIT and SPLIT FILE OFF])
150 AT_DATA([show.sps], [dnl
155 DATA LIST LIST NOTABLE/x y z.
159 SPLIT FILE LAYERED BY y z.
162 SPLIT FILE SEPARATE BY x z.
168 AT_CHECK([pspp show.sps -O box=unicode], [0], [dnl
179 DATA LIST LIST NOTABLE/x y z.
186 ╭─────┬──────────────╮
187 │SPLIT│x, y (LAYERED)│
188 ╰─────┴──────────────╯
191 SPLIT FILE LAYERED BY y z.
196 ╭─────┬──────────────╮
197 │SPLIT│y, z (LAYERED)│
198 ╰─────┴──────────────╯
201 SPLIT FILE SEPARATE BY x z.
206 ╭─────┬───────────────╮
207 │SPLIT│x, z (SEPARATE)│
208 ╰─────┴───────────────╯