From 1c379f06c2def4173f6a7165314890bd7694290b Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 12 Aug 2008 06:32:23 -0600 Subject: [PATCH] Add test for m4_cond. * tests/m4sugar.at (m4@&t@_cond): New test. Reported by Ralf Wildenhues. Signed-off-by: Eric Blake --- ChangeLog | 6 ++++++ tests/m4sugar.at | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4c4cc3ad..8c1faa21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-12 Eric Blake + + Add test for m4_cond. + * tests/m4sugar.at (m4@&t@_cond): New test. + Reported by Ralf Wildenhues. + 2008-08-06 Eric Blake Fix autoheader 2.62 regression on AC_DEFINE([__EXTENSIONS__]). diff --git a/tests/m4sugar.at b/tests/m4sugar.at index 60910de8..b52b8335 100644 --- a/tests/m4sugar.at +++ b/tests/m4sugar.at @@ -191,6 +191,51 @@ autom4te: m4 failed with exit status: 1 AT_CLEANUP +## --------- ## +## m4_cond. ## +## --------- ## + +AT_SETUP([m4@&t@_cond]) + +AT_CHECK_M4SUGAR_TEXT([[m4_define([side], [m4_errprintn([$1])$1]) +m4_cond([side(1)], [1], [a], + [side(1)], [1], [b], + [side(1)], [2], [c]) +m4_cond([side(2)], [1], [a], + [side(2)], [1], [b], + [side(2)], [2], [c], + [side(2)]) +m4_cond([side(3)], [1], [a], + [side(3)], [1], [b], + [side(3)], [2], [c], + [side(3)]) +m4_cond([a,a], [a,a], [yes], [no]) +m4_cond([[a,a]], [a,a], [yes]) +m4_cond([a,a], [a,b], [yes], [no]) +m4_cond([a,a], [a,b], [yes]) +m4_cond([m4_eval([0xa])]) +]], [[ +a +c +3 +yes +yes +no + +10 +]], [[1 +2 +2 +2 +3 +3 +3 +3 +]]) + +AT_CLEANUP + + ## ---------- ## ## m4_split. ## ## ---------- ## -- 2.11.4.GIT