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([TITLE and related commands])
19 AT_SETUP([FILE LABEL and (ADD) DOCUMENT])
20 AT_DATA([file-label.sps], [dnl
21 /* Set up a dummy active dataset in memory.
31 /* Add value labels for some further testing of value labels.
32 value labels x y 1 'first label' 2 'second label' 3 'third label'.
33 add value labels x 1 'first label mark two'.
35 /* Add a file label and a few documents.
36 file label This is a test file label.
37 document First line of a document
38 Second line of a document
39 The last line should end with a period: .
42 /* Display the documents.
46 ADD DOCUMENT 'Line one' 'Line two'.
48 /* Save the active dataset then get it and display the documents again.
49 save /OUTFILE='foo.save'.
54 /* There is an interesting interaction that occurs if the 'execute'
55 /* command below. What happens is that an error message is output
56 /* at the next 'save' command that 'foo.save' is already open for
57 /* input. This is because the 'get' hasn't been executed yet and
58 /* therefore PSPP would be reading from and writing to the same
59 /* file at once, which is obviously a Bad Thing. But 'execute'
60 /* here clears up that potential problem.
63 /* Add another (shorter) document and try again.
64 document There should be another document now.
68 save /OUTFILE='foo.save'.
75 AT_CHECK([pspp -o pspp.csv file-label.sps])
76 dnl Filter out the dates/times
77 AT_CHECK([[sed 's/(Entered [^)]*)/(Entered <date>)/' pspp.csv]], [0], [dnl
78 Table: Reading 1 record from INLINE.
79 Variable,Record,Columns,Format
84 "document First line of a document
85 Second line of a document
86 The last line should end with a period: .
90 Label,This is a test file label
93 "document First line of a document
94 Second line of a document
95 The last line should end with a period: .
102 Label,This is a test file label
105 "document First line of a document
106 Second line of a document
107 The last line should end with a period: .
112 document There should be another document now.
116 "document First line of a document
117 Second line of a document
118 The last line should end with a period: .
123 document There should be another document now.
127 Label,This is a test file label