CVSROOT: /sources/m4 Module name: m4 Changes by: Eric Blake <ericb> 07/07/22 22:53:35
Index: tests/builtins.at =================================================================== RCS file: /sources/m4/m4/tests/builtins.at,v retrieving revision 1.42 retrieving revision 1.43 diff -u -b -r1.42 -r1.43 --- tests/builtins.at 10 Jul 2007 20:48:10 -0000 1.42 +++ tests/builtins.at 22 Jul 2007 22:53:35 -0000 1.43 @@ -188,6 +188,42 @@ hello world ]]) +dnl Test large diversions, which were broken in m4 1.4.8-1.4.10. +AT_DATA([in.m4], [M4_ONE_MEG_DEFN[divert(`2')f`'dnl +divert(`1')hello +divert(`3')goodbye +]]) + +dnl Rather than open-code the 1 megabyte expected output, we reduce the +dnl size of testsuite by constructing it. +AT_DATA([expout], [[ +]]) +cat expout expout > expout2 +cat expout2 expout2 > expout +cat expout expout > expout2 +cat expout2 expout2 > expout +cat expout expout > expout2 +cat expout2 expout2 > expout +cat expout expout > expout2 +cat expout2 expout2 > expout +cat expout expout > expout2 +cat expout2 expout2 > expout +cat expout expout > expout2 +cat expout2 expout2 > expout +cat expout expout > expout2 +cat expout2 expout2 > expout +cat expout expout > expout2 +cat expout2 expout2 > expout +cat expout expout > expout2 +cat expout2 expout2 > expout +cat expout expout > expout2 # 512 kilobytes +echo hello > expout +cat expout2 expout2 >> expout # 1 megabyte +echo goodbye >> expout +rm expout2 + +AT_CHECK_M4([in.m4], [0], [expout]) + AT_CLEANUP