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/>.
19 AT_SETUP([LIST plain cases])
20 AT_DATA([data.txt], [dnl
33 AT_DATA([list.sps], [dnl
34 DATA LIST FILE='data.txt'/avar 1-5 bvar 6-10.
38 AT_CHECK([pspp -o pspp.csv list.sps])
39 AT_CHECK([cat pspp.csv], [0], [dnl
40 Table: Reading 1 record from `data.txt'.
41 Variable,Record,Columns,Format
61 AT_SETUP([LIST numbered cases])
62 AT_DATA([data.txt], [dnl
75 AT_DATA([list.sps], [dnl
76 DATA LIST FILE='data.txt'/avar 1-5 bvar 6-10.
80 AT_CHECK([pspp -o pspp.csv list.sps])
81 AT_CHECK([cat pspp.csv], [0], [dnl
82 Table: Reading 1 record from `data.txt'.
83 Variable,Record,Columns,Format
103 # Checks for a crash when LIST did not include the variables from SPLIT
104 # FILE in the same positions (bug #30684).
105 AT_SETUP([LIST with split file])
106 AT_DATA([data.txt], [dnl
114 AT_DATA([list.sps], [dnl
115 DATA LIST LIST NOTABLE FILE='data.txt'/s (a1) n.
119 AT_CHECK([pspp -o pspp.csv list.sps])
120 AT_CHECK([cat pspp.csv], [0], [dnl
150 AT_SETUP([LIST lots of variables])
151 AT_DATA([data.txt], [dnl
152 767532466348513789073483106409
153 888693089424177542378334186760
154 492611507909187152726427852242
155 819848892023195875879332001491
156 452777898709563729845541516650
157 239961967077732760663525115073
159 AT_DATA([list.sps], [dnl
160 DATA LIST FILE='data.txt' NOTABLE/x01 to x30 1-30.
163 AT_CHECK([pspp -o pspp.csv list.sps])
164 AT_CHECK([cat pspp.csv], [0], [dnl
166 x01,x02,x03,x04,x05,x06,x07,x08,x09,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25,x26,x27,x28,x29,x30
167 7,6,7,5,3,2,4,6,6,3,4,8,5,1,3,7,8,9,0,7,3,4,8,3,1,0,6,4,0,9
168 8,8,8,6,9,3,0,8,9,4,2,4,1,7,7,5,4,2,3,7,8,3,3,4,1,8,6,7,6,0
169 4,9,2,6,1,1,5,0,7,9,0,9,1,8,7,1,5,2,7,2,6,4,2,7,8,5,2,2,4,2
170 8,1,9,8,4,8,8,9,2,0,2,3,1,9,5,8,7,5,8,7,9,3,3,2,0,0,1,4,9,1
171 4,5,2,7,7,7,8,9,8,7,0,9,5,6,3,7,2,9,8,4,5,5,4,1,5,1,6,6,5,0
172 2,3,9,9,6,1,9,6,7,0,7,7,7,3,2,7,6,0,6,6,3,5,2,5,1,1,5,0,7,3
176 AT_SETUP([LIST selected cases])
177 AT_DATA([data.txt], [dnl
204 AT_DATA([list.sps], [dnl
205 DATA LIST FILE='data.txt' NOTABLE/x0 to x9 1-10.
206 LIST /CASES=FROM 6 TO 20 BY 5.
212 AT_CHECK([pspp -o pspp.csv list.sps])
213 AT_CHECK([cat pspp.csv], [0], [dnl
215 x0,x1,x2,x3,x4,x5,x6,x7,x8,x9
221 x0,x1,x2,x3,x4,x5,x6,x7,x8,x9
228 x0,x1,x2,x3,x4,x5,x6,x7,x8,x9
234 x0,x1,x2,x3,x4,x5,x6,x7,x8,x9
238 x0,x1,x2,x3,x4,x5,x6,x7,x8,x9
242 dnl This program tests for a bug which caused a buffer overflow
243 dnl when the list command attempted to write very long strings.
244 AT_SETUP([LIST very long string])
245 AT_DATA([list.sps], [dnl
248 + COMPUTE foo=CONCAT(RPAD('A',1999, 'x'), 'Z').
259 AT_CHECK([pspp -o pspp.csv list.sps])
260 AT_CHECK([cat psp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UP([LIST crash on invalid input])
275 AT_DATA([list.sps], [dnl
286 AT_CHECK([pspp -o pspp.csv list.sps], [1], [ignore])
290 dnl This is an example from doc/tutorial.texi
291 dnl So if the results of this have to be changed in any way,
292 dnl make sure to update that file.
293 AT_SETUP([LIST tutorial example])
294 AT_DATA([list.sps], [dnl
295 data list list /forename (A12) height.
303 list /format=numbered.
305 AT_CHECK([pspp -o pspp.csv -o pspp.txt list.sps])
306 AT_CHECK([cat pspp.csv], [0], [dnl
307 Table: Reading free-form data from INLINE.
313 Case Number,forename,height