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