[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: faster m4_divert*,m4_cond
From: |
Eric Blake |
Subject: |
Re: faster m4_divert*,m4_cond |
Date: |
Tue, 12 Aug 2008 06:40:19 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Ralf Wildenhues on 8/11/2008 10:06 PM:
| * Eric Blake wrote on Tue, Aug 12, 2008 at 05:56:31AM CEST:
|> Yes, I should add a test case along the lines of the following:
|
| Yes, please, that prevents someone (else) later breaking this
| inadvertently.
Done:
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkihhLMACgkQ84KuGfSFAYDYAgCeMrYF4Q/5C4T3Ky4a/dSQj9/u
B2IAoJQBOh0zNbb7Yd2OfxF7qPIjpfVu
=b4gJ
-----END PGP SIGNATURE-----
>From 1c379f06c2def4173f6a7165314890bd7694290b Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Tue, 12 Aug 2008 06:32:23 -0600
Subject: [PATCH] Add test for m4_cond.
* tests/m4sugar.at (m4@&address@hidden): New test.
Reported by Ralf Wildenhues.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 6 ++++++
tests/m4sugar.at | 45 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4c4cc3a..8c1faa2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-12 Eric Blake <address@hidden>
+
+ Add test for m4_cond.
+ * tests/m4sugar.at (m4@&address@hidden): New test.
+ Reported by Ralf Wildenhues.
+
2008-08-06 Eric Blake <address@hidden>
Fix autoheader 2.62 regression on AC_DEFINE([__EXTENSIONS__]).
diff --git a/tests/m4sugar.at b/tests/m4sugar.at
index 60910de..b52b833 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@&address@hidden)
+
+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. ##
## ---------- ##
--
1.5.6.4