Add copyright and licence notices to files which lack them.
[pspp] / tests / language / utilities / title.at
1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
3 dnl 
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.
8 dnl 
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.
13 dnl 
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/>.
16 dnl AT_BANNER([TITLE and related commands])
17
18 AT_SETUP([FILE LABEL and (ADD) DOCUMENT])
19 AT_DATA([file-label.sps], [dnl
20 /* Set up a dummy active dataset in memory.
21 data list /X 1 Y 2.
22 begin data.
23 16
24 27
25 38
26 49
27 50
28 end data.
29
30 /* Add value labels for some further testing of value labels.
31 value labels x y 1 'first label' 2 'second label' 3 'third label'.
32 add value labels x 1 'first label mark two'.
33
34 /* Add a file label and a few documents.
35 file label This is a test file label.
36 document First line of a document
37 Second line of a document
38 The last line should end with a period: .
39
40
41 /* Display the documents.
42 display documents.
43 display file label.
44
45 ADD DOCUMENT 'Line one' 'Line two'.
46
47 /* Save the active dataset then get it and display the documents again.
48 save /OUTFILE='foo.save'.
49 get /FILE='foo.save'.
50 display documents.
51 display file label.
52
53 /* There is an interesting interaction that occurs if the 'execute'
54 /* command below.  What happens is that an error message is output
55 /* at the next 'save' command that 'foo.save' is already open for
56 /* input.  This is because the 'get' hasn't been executed yet and
57 /* therefore PSPP would be reading from and writing to the same
58 /* file at once, which is obviously a Bad Thing.  But 'execute'
59 /* here clears up that potential problem.
60 execute.
61
62 /* Add another (shorter) document and try again.
63 document There should be another document now.
64 display documents.
65
66 /* Save and get.
67 save /OUTFILE='foo.save'.
68 get /FILE='foo.save'.
69 display documents.
70 display file label.
71
72 /* Done.
73 ])
74 AT_CHECK([pspp -o pspp.csv file-label.sps])
75 dnl Filter out the dates/times
76 AT_CHECK([[sed 's/(Entered [^)]*)/(Entered <date>)/' pspp.csv]], [0], [dnl
77 Table: Reading 1 record from INLINE.
78 Variable,Record,Columns,Format
79 X,1,1-  1,F1.0
80 Y,1,2-  2,F1.0
81
82 Documents in the active dataset:
83
84 document First line of a document
85
86 Second line of a document
87
88 The last line should end with a period: .
89
90 (Entered <date>)
91
92 File label: This is a test file label
93
94 Documents in the active dataset:
95
96 document First line of a document
97
98 Second line of a document
99
100 The last line should end with a period: .
101
102 (Entered <date>)
103
104 Line one
105
106 Line two
107
108 (Entered <date>)
109
110 File label: This is a test file label
111
112 Documents in the active dataset:
113
114 document First line of a document
115
116 Second line of a document
117
118 The last line should end with a period: .
119
120 (Entered <date>)
121
122 Line one
123
124 Line two
125
126 (Entered <date>)
127
128 document There should be another document now.
129
130 (Entered <date>)
131
132 Documents in the active dataset:
133
134 document First line of a document
135
136 Second line of a document
137
138 The last line should end with a period: .
139
140 (Entered <date>)
141
142 Line one
143
144 Line two
145
146 (Entered <date>)
147
148 document There should be another document now.
149
150 (Entered <date>)
151
152 File label: This is a test file label
153 ])
154 AT_CLEANUP