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