Merge remote-tracking branch 'origin/master' into sheet
[pspp] / tests / language / xforms / select-if.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([FILTER])
18
19 AT_SETUP([FILTER])
20 AT_DATA([filter.sps], [dnl
21 data list notable /X 1-2.
22 begin data.
23 1
24 2
25 3
26 4
27 5
28 6
29 7
30 8
31 9
32 10
33 end data.
34 compute FILTER_$ = mod(x,2).
35
36 filter by filter_$.
37 list.
38 filter off.
39 list.
40 compute filter_$ = 1 - filter_$.
41 filter by filter_$.
42 list.
43 ])
44 AT_CHECK([pspp -o pspp.csv filter.sps])
45 AT_CHECK([cat pspp.csv], [0], [dnl
46 Table: Data List
47 X,FILTER_$
48 1,1.00
49 3,1.00
50 5,1.00
51 7,1.00
52 9,1.00
53
54 Table: Data List
55 X,FILTER_$
56 1,1.00
57 2,.00
58 3,1.00
59 4,.00
60 5,1.00
61 6,.00
62 7,1.00
63 8,.00
64 9,1.00
65 10,.00
66
67 Table: Data List
68 X,FILTER_$
69 2,1.00
70 4,1.00
71 6,1.00
72 8,1.00
73 10,1.00
74 ])
75 AT_CLEANUP