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/>.
19 AT_SETUP([simple macro expansion])
20 AT_DATA([define.sps], [dnl
28 "a" "b" "c" 'a' 'b' 'c'.
34 AT_CHECK([pspp --testing-mode define.sps], [0], [dnl
39 "a" "b" "c" 'a' 'b' 'c'.
44 AT_SETUP([macro expansion with arguments])
45 AT_DATA([define.sps], [dnl
46 DEFINE !title(!positional !tokens(1)) !1 !ENDDEFINE.
47 DEFINE !t1(!positional !tokens(1)) t1 (!1) !ENDDEFINE.
48 DEFINE !t2(!positional !tokens(2)) t2 (!1) !ENDDEFINE.
50 DEFINE !ce(!positional !charend('/')) ce (!1) !ENDDEFINE.
51 DEFINE !ce2(!positional !charend('(')
52 /!positional !charend(')'))
56 DEFINE !e(!positional !enclose('{','}')) e (!1) !ENDDEFINE.
58 DEFINE !cmd(!positional !cmdend) cmd(!1) !ENDDEFINE.
59 DEFINE !cmd2(!positional !cmdend
60 /!positional !tokens(1))
65 !title "!TOKENS(1) argument."
70 !title "!TOKENS(2) argument."
74 !title "!CHAREND argument."
80 !title "Two !CHAREND arguments."
84 !title "!ENCLOSE argument."
89 !title "!CMDEND argument."
94 AT_CHECK([pspp --testing-mode define.sps], [0], [dnl
95 "!TOKENS(1) argument."
103 note: unexpanded token "b"
105 "!TOKENS(2) argument."
111 note: unexpanded token "d"
123 "Two !CHAREND arguments."