Add copyright and licence notices to files which lack them.
[pspp] / tests / language / dictionary / vector.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([VECTOR])
17
18 AT_SETUP([VECTOR short form])
19 AT_DATA([vector.sps], [dnl
20 data list notable/x 1.
21 vector v(4).
22 display vector.
23 ])
24 AT_CHECK([pspp -o pspp.csv vector.sps])
25 AT_CHECK([cat pspp.csv], [0], [dnl
26 Vector,Position,Variable,Print Format
27 v,1,v1,F8.2
28 ,2,v2,F8.2
29 ,3,v3,F8.2
30 ,4,v4,F8.2
31 ])
32 AT_CLEANUP
33
34 AT_SETUP([VECTOR short form with format specification])
35 AT_DATA([vector.sps], [dnl
36 data list notable/x 1.
37 vector #vec(4, comma10.2)
38       /#svec(3, a8).
39 display vector.
40 ])
41 AT_CHECK([pspp -o pspp.csv vector.sps])
42 AT_CHECK([cat pspp.csv], [0], [dnl
43 Vector,Position,Variable,Print Format
44 #vec,1,#vec1,COMMA10.2
45 ,2,#vec2,COMMA10.2
46 ,3,#vec3,COMMA10.2
47 ,4,#vec4,COMMA10.2
48 #svec,1,#svec1,A8
49 ,2,#svec2,A8
50 ,3,#svec3,A8
51 ])
52 AT_CLEANUP
53
54 AT_SETUP([VECTOR short form in INPUT PROGRAM])
55 AT_DATA([vector.sps], [dnl
56 input program.
57 vector x(5).
58 data list notable/x5 x2 x3 x1 x4 1-5.
59 end input program.
60 display vector.
61 ])
62 AT_CHECK([pspp -o pspp.csv vector.sps])
63 AT_CHECK([cat pspp.csv], [0], [dnl
64 Vector,Position,Variable,Print Format
65 x,1,x1,F8.2
66 ,2,x2,F8.2
67 ,3,x3,F8.2
68 ,4,x4,F8.2
69 ,5,x5,F8.2
70 ])
71 AT_CLEANUP
72
73 AT_SETUP([VECTOR long form])
74 AT_DATA([vector.sps], [dnl
75 data list notable/u w x y z 1-5.
76 vector a=u to y.
77 vector b=x to z.
78 vector c=all.
79 display vector.
80 ])
81 AT_CHECK([pspp -o pspp.csv vector.sps])
82 AT_CHECK([cat pspp.csv], [0], [dnl
83 Vector,Position,Variable,Print Format
84 a,1,u,F1.0
85 ,2,w,F1.0
86 ,3,x,F1.0
87 ,4,y,F1.0
88 b,1,x,F1.0
89 ,2,y,F1.0
90 ,3,z,F1.0
91 c,1,u,F1.0
92 ,2,w,F1.0
93 ,3,x,F1.0
94 ,4,y,F1.0
95 ,5,z,F1.0
96 ])
97 AT_CLEANUP