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 dnl Tests for a bug which caused the second procedure
20 dnl after GET to have corrupt input.
21 AT_SETUP([GET data works in multiple procedures])
22 AT_DATA([get.sps], [dnl
23 DATA LIST LIST NOTABLE /LOCATION * EDITOR * SHELL * FREQ * .
35 SAVE /OUTFILE='foo.sav'.
42 * But this one get rubbish
45 AT_CHECK([pspp -o pspp.csv get.sps])
46 AT_CHECK([cat pspp.csv], [0], [dnl
48 LOCATION,EDITOR,SHELL,FREQ
59 LOCATION,EDITOR,SHELL,FREQ
71 dnl Tests for a bug that crashed when GET specified a nonexistent file.
72 AT_SETUP([GET nonexistent file doesn't crash])
73 dnl We use stdin here, because the bug seems to manifest itself only in
75 AT_CHECK([echo "GET /FILE='nonexistent.sav'." | pspp -O format=csv], [1], [dnl
76 error: An error occurred while opening `nonexistent.sav': No such file or directory.
80 dnl Tests for bug #15766 (/KEEP subcommand on SAVE doesn't
81 dnl fully support ALL) and underlying problems.
82 m4_define([GET_KEEP_ALL],
83 [AT_SETUP([GET with /KEEP=ALL crashes -- $1])
84 AT_DATA([get.sps], [dnl
85 DATA LIST LIST NOTABLE
86 /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).
88 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
91 SAVE OUTFILE='test.sav'/$1.
92 GET FILE='test.sav'/KEEP=x y z all.
95 AT_CHECK([pspp -o pspp.csv get.sps])
96 AT_CHECK([cat pspp.csv], [0], [dnl
98 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
99 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
102 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
103 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
106 GET_KEEP_ALL([uncompressed])
107 GET_KEEP_ALL([compressed])
110 dnl Test for a crash when no /TYPE was provided
111 AT_SETUP([GET data no type])
112 AT_DATA([get.sps], [dnl
113 get data /file='anything'.
116 AT_CHECK([pspp get.sps], [1], [ignore])