diff options
Diffstat (limited to 'tests/gentest/define.2.test')
-rwxr-xr-x | tests/gentest/define.2.test | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/gentest/define.2.test b/tests/gentest/define.2.test new file mode 100755 index 00000000..028642c3 --- /dev/null +++ b/tests/gentest/define.2.test @@ -0,0 +1,29 @@ +#!/bin/sh + +# gentest/define.2.test 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 + |