summaryrefslogtreecommitdiff
path: root/tests/gentest/loops.2.test
blob: 5e38e47efa12450ae1ac7dc2e7cde2aca8ae3439 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

# gentest/loops.2.test is part of the GNU m4 testsuite
# generated from example in ../doc/m4.texinfo line 1546

. ${srcdir}/defs

cat <<\EOF >in
define(`reverse', `ifelse($#, 0, , $#, 1, ``$1'',
			  `reverse(shift($@)), `$1'')')
reverse
reverse(foo)
reverse(foo, bar, gnats, and gnus)
EOF

cat <<\EOF >ok


foo
and gnus, gnats, bar, foo
EOF

$M4 -d in >out

$CMP -s out ok