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