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([DATASET commands])
19 AT_SETUP([DATASET COPY])
20 AT_DATA([dataset.pspp], [dnl
22 DATA LIST NOTABLE /x 1.
34 DATA LIST NOTABLE /y 1.
43 DATASET ACTIVATE clone.
47 DATASET ACTIVATE initial.
54 DATASET ACTIVATE clone.
59 DATASET CLOSE initial.
62 AT_CHECK([pspp -O format=csv dataset.pspp], [0], [dnl
71 initial (active dataset)
74 clone (active dataset)
87 initial (active dataset)
102 unnamed dataset (active dataset)
106 unnamed dataset (active dataset)
110 AT_SETUP([DATASET DECLARE])
111 AT_DATA([dataset.pspp], [dnl
112 DATASET DECLARE second.
114 DATA LIST NOTABLE/x 1.
119 DATASET ACTIVATE second.
123 AT_CHECK([pspp -O format=csv dataset.pspp], [1], [dnl
125 unnamed dataset (active dataset)
133 second (active dataset)
135 dataset.pspp:10: error: LIST: LIST is allowed only after the active dataset has been defined.
139 AT_SETUP([DATASET NAME deletes duplicate name])
140 AT_DATA([dataset.pspp], [dnl
150 AT_CHECK([pspp -O format=csv dataset.pspp], [0], [dnl
161 AT_SETUP([DATASET ACTIVATE deletes unnamed dataset])
162 AT_DATA([dataset.pspp], [dnl
169 AT_CHECK([pspp -O format=csv dataset.pspp], [0], [dnl
171 unnamed dataset (active dataset)
179 AT_SETUP([DATASET ACTIVATE executes pending transformations])
180 AT_DATA([dataset.pspp], [dnl
182 DATASET DECLARE another.
185 DATA LIST NOTABLE /x 1.
187 DATASET ACTIVATE another.
198 DATASET ACTIVATE one.
201 AT_CHECK([pspp -O format=csv dataset.pspp], [1], [dnl
216 dataset.pspp:16: error: LIST: LIST is allowed only after the active dataset has been defined.
228 AT_SETUP([DATASET CLOSE])
229 AT_DATA([dataset.pspp], [dnl
244 DATASET DECLARE that.
245 DATASET DECLARE theother.
246 DATASET DECLARE yetanother.
252 DATASET DECLARE that.
253 DATASET DECLARE theother.
254 DATASET DECLARE yetanother.
259 AT_CHECK([pspp -O format=csv dataset.pspp], [0], [dnl
261 unnamed dataset (active dataset)
264 unnamed dataset (active dataset)
267 this (active dataset)
270 unnamed dataset (active dataset)
273 this (active dataset)
276 unnamed dataset (active dataset)
279 unnamed dataset (active dataset)
285 unnamed dataset (active dataset)
290 this (active dataset)
294 unnamed dataset (active dataset)
300 dnl The bug for which the following test checks, is apparent only
301 dnl when compiled with -fsanitize=address or run under valgrind
302 AT_SETUP([DATASET heap overflow])
303 AT_DATA([dataset.pspp], [dnl
304 DATASET DECLARE initial.
314 DATASET ACTIVATE subsq.
319 AT_CHECK([pspp -O format=csv dataset.pspp], [0], [dnl
320 Table: Reading 1 record from INLINE.
321 Variable,Record,Columns,Format
324 Table: Reading 1 record from INLINE.
325 Variable,Record,Columns,Format