Add copyright and licence notices to files which lack them.
[pspp] / tests / language / dictionary / sys-file-info.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([SYSFILE INFO])
17
18 AT_SETUP([SYSFILE INFO])
19 AT_DATA([sysfile-info.sps], [dnl
20 DATA LIST LIST /x * name (a10) .
21 BEGIN DATA
22 1 one
23 2 two
24 3 three
25 END DATA.
26 SAVE OUTFILE='pro.sav'.
27
28 sysfile info file='pro.sav'.
29 ])
30 AT_CHECK([pspp -o pspp.csv sysfile-info.sps])
31 AT_CHECK(
32   [sed -e '/^Created:,/d' \
33        -e '/^Endian:,/d' \
34        -e '/^Integer Format:,/d' \
35        -e '/^Real Format:,/d' \
36        -e '/^Encoding:,/d' pspp.csv],
37   [0], [dnl
38 Table: Reading free-form data from INLINE.
39 Variable,Format
40 x,F8.0
41 name,A10
42
43 File:,pro.sav
44 Label:,No label.
45 Variables:,2
46 Cases:,3
47 Type:,SPSS System File
48 Weight:,Not weighted.
49 Compression:,SAV
50
51 Variable,Description,Position
52 x,"Format: F8.2
53 Measure: Scale
54 Role: Input
55 Display Alignment: Right
56 Display Width: 8",1
57 name,"Format: A10
58 Measure: Nominal
59 Role: Input
60 Display Alignment: Left
61 Display Width: 10",2
62 ])
63 AT_CLEANUP
64
65 AT_BANNER([DISPLAY])
66
67 dnl DISPLAY DOCUMENTS is tested with commands for documents.
68
69 AT_SETUP([DISPLAY FILE LABEL])
70 AT_DATA([display.sps], [dnl
71 DATA LIST LIST NOTABLE /x * name (a10) .
72
73 DISPLAY FILE LABEL.
74
75 FILE LABEL 'foo bar baz quux'.
76 DISPLAY FILE LABEL.
77 ])
78 AT_CHECK([pspp -O format=csv display.sps], [0], [dnl
79 The active dataset does not have a file label.
80
81 File label: foo bar baz quux
82 ])
83 AT_CLEANUP
84
85 dnl DISPLAY VECTORS is tested with commands for vectors.
86
87 dnl DISPLAY ATTRIBUTES and @ATTRIBUTES are tested with commands for attributes.
88
89 AT_SETUP([DISPLAY SCRATCH])
90 AT_DATA([sysfile-info.sps], [dnl
91 DATA LIST LIST NOTABLE /x * name (a10) .
92 DISPLAY SCRATCH.
93 COMPUTE #x=0.
94 DISPLAY SCRATCH.
95 ])
96 AT_CHECK([pspp -O format=csv sysfile-info.sps], [0], [dnl
97 sysfile-info.sps:2: warning: DISPLAY: No variables to display.
98
99 Variable
100 #x
101 ])
102 AT_CLEANUP
103
104 AT_SETUP([DISPLAY INDEX])
105 AT_DATA([sysfile-info.sps], [dnl
106 DATA LIST LIST NOTABLE /x * name (a10) .
107 DISPLAY INDEX.
108 ])
109 AT_CHECK([pspp -O format=csv sysfile-info.sps], [0], [dnl
110 Variable,Position
111 x,1
112 name,2
113 ])
114 AT_CLEANUP
115
116 AT_SETUP([DISPLAY NAMES])
117 AT_DATA([sysfile-info.sps], [dnl
118 DATA LIST LIST NOTABLE /x * name (a10) .
119 DISPLAY NAMES.
120 ])
121 AT_CHECK([pspp -O format=csv sysfile-info.sps], [0], [dnl
122 Variable
123 x
124 name
125 ])
126 AT_CLEANUP
127
128 AT_SETUP([DISPLAY LABELS])
129 AT_DATA([sysfile-info.sps], [dnl
130 DATA LIST LIST NOTABLE /x * name (a10) .
131 VARIABLE LABEL x 'variable one' name 'variable two'.
132 VALUE LABEL x 1 'asdf' 2 'jkl;'.
133 DISPLAY LABELS.
134 ])
135 AT_CHECK([pspp -O format=csv sysfile-info.sps], [0], [dnl
136 Variable,Label,Position
137 x,variable one,1
138 name,variable two,2
139 ])
140 AT_CLEANUP
141
142 dnl DISPLAY VARIABLES Is tested in multiple places.