Add copyright and licence notices to files which lack them.
[pspp] / tests / language / lexer / variable-parser.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([Variable parser])
17
18 dnl This program tests that both long and short variable names are parsed OK.
19 dnl It use CROSSTABS, since its TABLES subcommand exercises the array var set 
20 dnl feature.
21 AT_SETUP([Long variable names])
22 AT_DATA([longvars.sps], [dnl
23 DATA LIST LIST /AlphaBetaGamma * B * X * Yabbadabbadoo * .
24 BEGIN DATA.
25 2 3 4 5
26 END DATA.
27
28 LIST.
29
30 CROSSTABS 
31         VARIABLES X (1,7) Yabbadabbadoo (1,7) 
32         /TABLES X BY Yabbadabbadoo.
33 ])
34 AT_CHECK([pspp -o pspp.csv longvars.sps])
35 AT_CHECK([cat pspp.csv], [0], [dnl
36 Table: Reading free-form data from INLINE.
37 Variable,Format
38 AlphaBetaGamma,F8.0
39 B,F8.0
40 X,F8.0
41 Yabbadabbadoo,F8.0
42
43 Table: Data List
44 AlphaBetaGamma,B,X,Yabbadabbadoo
45 2.00,3.00,4.00,5.00
46
47 Table: Summary.
48 ,Cases,,,,,
49 ,Valid,,Missing,,Total,
50 ,N,Percent,N,Percent,N,Percent
51 X * Yabbadabbadoo,1,100.0%,0,0.0%,1,100.0%
52
53 Table: X * Yabbadabbadoo [[count]].
54 ,Yabbadabbadoo,,,,,,,
55 X,1.00,2.00,3.00,4.00,5.00,6.00,7.00,Total
56 1.00,.00,.00,.00,.00,.00,.00,.00,.00
57 2.00,.00,.00,.00,.00,.00,.00,.00,.00
58 3.00,.00,.00,.00,.00,.00,.00,.00,.00
59 4.00,.00,.00,.00,.00,1.00,.00,.00,1.00
60 5.00,.00,.00,.00,.00,.00,.00,.00,.00
61 6.00,.00,.00,.00,.00,.00,.00,.00,.00
62 7.00,.00,.00,.00,.00,.00,.00,.00,.00
63 Total,.00,.00,.00,.00,1.00,.00,.00,1.00
64 ])
65 AT_CLEANUP