]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Test m4_transform without tickling shell bugs.
authorEric Blake <ebb9@byu.net>
Tue, 19 Aug 2008 04:20:37 +0000 (22:20 -0600)
committerEric Blake <ebb9@byu.net>
Tue, 19 Aug 2008 04:20:37 +0000 (22:20 -0600)
* tests/m4sh.at (AS@&t@_IF and AS@&t@_CASE): Relax test to
something more manageable.
* tests/m4sugar.at (recursion): Move stress test of
m4_transform_pair here.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
tests/m4sh.at
tests/m4sugar.at

index 442baadcd317de3e91a3f2b721c90787ced543bd..562e9e14d91b593b9f07b86cc807743a834577fd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2008-08-18  Eric Blake  <ebb9@byu.net>
 
+       Test m4_transform without tickling shell bugs.
+       * tests/m4sh.at (AS@&t@_IF and AS@&t@_CASE): Relax test to
+       something more manageable.
+       * tests/m4sugar.at (recursion): Move stress test of
+       m4_transform_pair here.
+       Reported by Ralf Wildenhues.
+
        Let 'git diff' give better context for doc updates.
        * .gitattributes (*.texi*): Add new entry.
        * README-hacking: Mention how to use it.
index ac5f8ba8603e8e4e52a4d366242bd485ade31c71..f64d8329957ccde4cfd398470cd2d883b0a5be3c 100644 (file)
@@ -634,7 +634,7 @@ AT_CLEANUP
 
 AT_SETUP([AS@&t@_IF and AS@&t@_CASE])
 
-AT_KEYWORDS([m4@&t@_foreach_pair])
+AT_KEYWORDS([m4@&t@_transform_pair])
 
 AT_DATA_M4SH([script.as], [[dnl
 AS_INIT
@@ -728,13 +728,15 @@ foo9=9 bar9=9
 ]])
 
 dnl stress test for large number of conditionals
+dnl too large, and we start tickling shell bugs
+m4_pushdef([limit], [100])dnl
 AT_DATA_M4SH([script.as], [[dnl
 AS_INIT
-AS_IF(m4_shift(m4_for([i], [1], [1000], [], [, test $[1] = i, echo i])))
-AS_IF(m4_shift(m4_for([i], [1], [1000], [], [, test $[1] = i, echo i])),
+AS_IF(m4_shift(m4_for([i], [1], ]limit[, [], [, test $[1] = i, echo i])))
+AS_IF(m4_shift(m4_for([i], [1], ]limit[, [], [, test $[1] = i, echo i])),
       [echo default])
-AS_CASE([$[1]]m4_for([i], [1], [1000], [], [, i, echo i]))
-AS_CASE([$[1]]m4_for([i], [1], [1000], [], [, i, echo i]), [echo default])
+AS_CASE([$[1]]m4_for([i], [1], ]limit[, [], [, i, echo i]))
+AS_CASE([$[1]]m4_for([i], [1], ]limit[, [], [, i, echo i]), [echo default])
 ]])
 
 AT_CHECK_M4SH
@@ -743,14 +745,15 @@ AT_CHECK([./script 1], [0], [[1
 1
 1
 ]])
-AT_CHECK([./script 1000], [0], [[1000
-1000
-1000
-1000
-]])
+AT_CHECK([./script limit], [0], [limit
+limit
+limit
+limit
+])
 AT_CHECK([./script default], [0], [[default
 default
 ]])
+m4_popdef([limit])
 
 AT_CLEANUP
 
index 75207e4dea6a209a66d3204a4234def748bf6027..a8cecf90419edd7a0e1fa19299841658e4883c16 100644 (file)
@@ -926,7 +926,7 @@ AT_SETUP([recursion])
 AT_KEYWORDS([m4@&t@_foreach m4@&t@_foreach_w m4@&t@_case m4@&t@_cond
 m4@&t@_bpatsubsts m4@&t@_shiftn m4@&t@_do m4@&t@_dquote_elt m4@&t@_reverse
 m4@&t@_map m4@&t@_join m4@&t@_joinall m4@&t@_list_cmp m4@&t@_max m4@&t@_min
-m4@&t@_bmatch])
+m4@&t@_bmatch m4@&t@_transform m4@&t@_transform_pair])
 
 dnl This test completes in a reasonable time if m4_foreach is linear,
 dnl but thrashes if it is quadratic.  If we are testing with m4 1.4.x,
@@ -954,6 +954,8 @@ m4_bpatsubsts([a1]m4_for([i], [1], [10000], [], [,i]), [a2], [A])
 m4_bmatch([9997]m4_for([i], [1], [10000], [], [,^i$]))
 m4_define([up], [m4_define([$1], m4_incr($1))$1])m4_define([j], 0)dnl
 m4_cond(m4_for([i], [1], [10000], [], [[up([j])], [9990], i,]) [oops]) j
+m4_count(m4_transform_pair([,m4_quote], []m4_transform([,m4_echo]m4_for([i],
+  [1], [10000], [], [,i]))))
 m4_divert_pop(0)
 ]])
 
@@ -969,6 +971,7 @@ end
 A
 ^9998$
 9990 9990
+5001
 ]])
 
 AT_DATA_M4SUGAR([script.4s],
@@ -986,6 +989,7 @@ end
 A
 ^9998$
 9990 9990
+5001
 m4_exit([0])])
 m4_init
 m4_divert_push(0)[]dnl
@@ -1007,6 +1011,8 @@ m4_bpatsubsts([a1]m4_for([i], [1], [10000], [], [,i]), [a2], [A])
 m4_bmatch([9997]m4_for([i], [1], [10000], [], [,^i$]))
 m4_define([up], [m4_define([$1], m4_incr($1))$1])m4_define([j], 0)dnl
 m4_cond(m4_for([i], [1], [10000], [], [[up([j])], [9990], i,]) [oops])
+m4_count(m4_transform_pair([,m4_quote], []m4_transform([,m4_echo]m4_for([i],
+  [1], [10000], [], [,i]))))
 m4_divert_pop(0)
 ]])
 
@@ -1022,6 +1028,7 @@ end
 A
 ^9998$
 9990 9990
+5001
 ]])
 
 AT_CLEANUP