checkin of 0.3.0
[pspp-builds.git] / tests / file-lab.stat
1 title 'Test FILE LABEL, DOCUMENT, DROP DOCUMENTS'.
2
3 /* Set up a dummy active file in memory.
4 data list /x 1 y 2.
5 begin data.
6 16
7 27
8 38
9 49
10 50
11 end data.
12
13 /* Add value labels for some further testing of value labels.
14 value labels x y 1 'first label' 2 'second label' 3 'third label'.
15 add value labels x 1 'first label mark two'.
16
17 /* Add a file label and a few documents.
18 file label This is a test file label.
19 document First line of a document
20 This is the second very long line of a document in an attempt to overflow the input buffer with a really long line
21 Note that the last line should end with a period: .
22
23 /* Display the documents.
24 display documents.
25 display file label.     /* undocumented feature of PSPP
26
27 /* Save the active file then get it and display the documents again.
28 save 'foo.save'.
29 get 'foo.save'.
30 display documents.
31 display file label.     /* undocumented feature of PSPP
32
33 /* There is an interesting interaction that occurs if the `execute'
34 /* command below.  What happens is that an error message is output
35 /* at the next `save' command that `foo.save' is already open for
36 /* input.  This is because the `get' hasn't been executed yet and
37 /* therefore PSPP would be reading from and writing to the same
38 /* file at once, which is obviously a Bad Thing.  But `execute'
39 /* here clears up that potential problem.
40 execute.
41
42 /* Add another (shorter) document and try again.
43 document There should be another document now.
44 display documents.
45
46 /* Save and get.
47 save 'foo.save'.
48 get 'foo.save'.
49 display documents.
50 display file label.     /* undocumented feature of PSPP
51
52 /* Done.
53