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
147 AT_SETUP([LIST lots of variables])
148 AT_DATA([data.txt], [dnl
149 767532466348513789073483106409
150 888693089424177542378334186760
151 492611507909187152726427852242
152 819848892023195875879332001491
153 452777898709563729845541516650
154 239961967077732760663525115073
156 AT_DATA([list.sps], [dnl
157 DATA LIST FILE='data.txt' NOTABLE/x01 to x30 1-30.
160 AT_CHECK([pspp -o pspp.csv list.sps])
161 AT_CHECK([cat pspp.csv], [0], [dnl
163 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
164 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
165 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
166 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
167 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
168 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
169 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
173 AT_SETUP([LIST selected cases])
174 AT_DATA([data.txt], [dnl
201 AT_DATA([list.sps], [dnl
202 DATA LIST FILE='data.txt' NOTABLE/x0 to x9 1-10.
203 LIST /CASES=FROM 6 TO 20 BY 5.
209 AT_CHECK([pspp -o pspp.csv list.sps])
210 AT_CHECK([cat pspp.csv], [0], [dnl
212 x0,x1,x2,x3,x4,x5,x6,x7,x8,x9
218 x0,x1,x2,x3,x4,x5,x6,x7,x8,x9
225 x0,x1,x2,x3,x4,x5,x6,x7,x8,x9
231 x0,x1,x2,x3,x4,x5,x6,x7,x8,x9
235 x0,x1,x2,x3,x4,x5,x6,x7,x8,x9
239 dnl This program tests for a bug which caused a buffer overflow
240 dnl when the list command attempted to write very long strings.
241 AT_SETUP([LIST very long string])
242 AT_DATA([list.sps], [dnl
245 + COMPUTE foo=CONCAT(RPAD('A',1999, 'x'), 'Z').
256 AT_CHECK([pspp -o pspp.csv list.sps])
257 AT_CHECK([cat psp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