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/>.
18 dnl Tests for a bug which caused the second procedure
19 dnl after GET to have corrupt input.
20 AT_SETUP([GET data works in multiple procedures])
21 AT_DATA([get.sps], [dnl
22 DATA LIST LIST NOTABLE /LOCATION * EDITOR * SHELL * FREQ * .
34 SAVE /OUTFILE='foo.sav'.
41 * But this one get rubbish
44 AT_CHECK([pspp -o pspp.csv get.sps])
45 AT_CHECK([cat pspp.csv], [0], [dnl
47 LOCATION,EDITOR,SHELL,FREQ
58 LOCATION,EDITOR,SHELL,FREQ
70 dnl Tests for a bug that crashed when GET specified a nonexistent file.
71 AT_SETUP([GET nonexistent file doesn't crash])
72 dnl We use stdin here, because the bug seems to manifest itself only in
74 AT_CHECK([echo "GET /FILE='nonexistent.sav'." | pspp -O format=csv], [1], [dnl
75 error: An error occurred while opening `nonexistent.sav': No such file or directory.
79 dnl Tests for bug #15766 (/KEEP subcommand on SAVE doesn't
80 dnl fully support ALL) and underlying problems.
81 m4_define([GET_KEEP_ALL],
82 [AT_SETUP([GET with /KEEP=ALL crashes -- $1])
83 AT_DATA([get.sps], [dnl
84 DATA LIST LIST NOTABLE
85 /a b c d e f g h i j k l m n o p q r s t u v w x y z (F2.0).
87 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
90 SAVE OUTFILE='test.sav'/$1.
91 GET FILE='test.sav'/KEEP=x y z all.
94 AT_CHECK([pspp -o pspp.csv get.sps])
95 AT_CHECK([cat pspp.csv], [0], [dnl
97 a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
98 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26
101 x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w
102 24,25,26,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23
105 GET_KEEP_ALL([uncompressed])
106 GET_KEEP_ALL([compressed])
109 dnl Test for a crash when no /TYPE was provided
110 AT_SETUP([GET data no type])
111 AT_DATA([get.sps], [dnl
112 get data /file='anything'.
115 AT_CHECK([pspp get.sps], [1], [ignore])