1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
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.
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.
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([SORT VARIABLES])
18 AT_SETUP([SORT VARIABLES])
19 # This reverses the order of its input lines.
20 # From the GNU sed manual.
28 cat > sort-variables.sps <<EOF
36 AT_CHECK_UNQUOTED([pspp -O format=csv sort-variables.sps], [0],
38 `for var in $4; do echo $var; done`
41 `for var in $4; do echo $var; done | tac`
45 test_sort 'x100 c b x99 a y400 y5' '' NAME 'a b c x99 x100 y5 y400'
46 test_sort 'c(a10) a(a5) b' '' TYPE 'b a c'
47 test_sort 'a (datetime) b (f) c (a5) d (a2) e (a1)' '' FORMAT 'e d c b a'
49 'VARIABLE LABEL a "hi there".' \
52 'VALUE LABELS a 123 "xyzzy".' \
55 'MISSING VALUES a (123).' \
58 'VARIABLE LEVEL a (SCALE) b (ORDINAL) c (NOMINAL).' \
60 test_sort 'b n i s t p' \
61 'VARIABLE ROLE /INPUT i /TARGET t /BOTH b /NONE n /PARTITION p /SPLIT s.' \
63 test_sort 'c10 c5 c15 c9' \
64 'VARIABLE WIDTH c10(10) c5(5) c15(15) c9(9).' \
65 COLUMNS 'c5 c9 c10 c15'
67 'VARIABLE ALIGNMENT c (CENTER) l (LEFT) r (RIGHT).' \
69 test_sort 'az ax ay ab' \
70 'VARIABLE ATTRIBUTE VARIABLES=az ATTRIBUTE=key("z").
71 VARIABLE ATTRIBUTE VARIABLES=ax ATTRIBUTE=key("x").
72 VARIABLE ATTRIBUTE VARIABLES=ay ATTRIBUTE=key("y").
73 VARIABLE ATTRIBUTE VARIABLES=ab ATTRIBUTE=key("b").' \
74 'ATTRIBUTE key' 'ab ax ay az'