DISPLAY FILE LABEL: Display in a more natural way.
[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: This is a test file label
78
79 Documents in the active dataset:
80
81 document First line of a document
82
83 Second line of a document
84
85 The last line should end with a period: .
86
87 (Entered <date>)
88
89 Line one
90
91 Line two
92
93 (Entered <date>)
94
95 File label: This is a test file label
96
97 Documents in the active dataset:
98
99 document First line of a document
100
101 Second line of a document
102
103 The last line should end with a period: .
104
105 (Entered <date>)
106
107 Line one
108
109 Line two
110
111 (Entered <date>)
112
113 document There should be another document now.
114
115 (Entered <date>)
116
117 Documents in the active dataset:
118
119 document First line of a document
120
121 Second line of a document
122
123 The last line should end with a period: .
124
125 (Entered <date>)
126
127 Line one
128
129 Line two
130
131 (Entered <date>)
132
133 document There should be another document now.
134
135 (Entered <date>)
136
137 File label: This is a test file label
138 ])
139 AT_CLEANUP