summaryrefslogtreecommitdiff
path: root/tests/gentest/define.2.m4
blob: 62e2ea0e479483a0520b4112da844b1d3810a545 (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
29
#!/bin/sh

# gentest/define.2.m4 is part of the GNU m4 testsuite
# generated from example in ../doc/m4.texinfo line 1007

. ${srcdir}/defs

cat <<\EOF >in
define(`array', `defn(format(``array[%d]'', `$1'))')
define(`array_set', `define(format(``array[%d]'', `$1'), `$2')')
array_set(4, `array element no. 4')
array_set(17, `array element no. 17')
array(4)
array(eval(10+7))
EOF

cat <<\EOF >ok




array element no. 4
array element no. 17
EOF

$M4 -d in >out

$CMP -s out ok