summaryrefslogtreecommitdiff
path: root/examples/foreach.test
blob: 969e16380479199d3f760e18cec9208623e2641d (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
27
28
#!/bin/sh

# foreach.test is part of the GNU m4 testsuite

. ${srcdir}/defs

cat ${srcdir}/foreach.m4 >in

cat <<\EOF >ok

Word was: foo
Word was: bar
Word was: foobar

# Something more complex, from Pierre Gaumond <gaumondp@ere.umontreal.ca>.
case "$1" in
  a)
    vara=" -a";;
  b)
    varb=" -b";;
  c)
    varc=" -c";;
esac
EOF

M4PATH=$srcdir:$srcdir/../tests $M4 -d in >out 2>err
sed -e "s, ../../src/m4:, m4:," err >sederr && mv sederr err
$CMP -s out ok