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