summaryrefslogtreecommitdiff
path: root/tests/m4sh.at
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2010-03-16 15:51:23 -0600
committerEric Blake <eblake@redhat.com>2010-07-02 11:35:34 -0600
commit07263c965a03c979f4712c6c5cfe9243911af0f9 (patch)
treeb38381b95621f2b1d42ed44aa334d55b0107d844 /tests/m4sh.at
parentbe4bf08802b79244f184dfd8dffa0fd5901df8f2 (diff)
downloadautoconf-07263c965a03c979f4712c6c5cfe9243911af0f9.tar.gz
Add AS_LITERAL_WORD_IF.
* lib/m4sugar/m4sh.m4 (_AS_LITERAL_IF): Also reject shell quoting characters as non-literal, and provide way to reject space. (AS_LITERAL_WORD_IF): New macro. * doc/autoconf.texi (Polymorphic Variables) <AS_LITERAL_IF>: Document new macro. Fix example to match reality. * NEWS: Document change and new macro. * tests/m4sh.at (AS@&t@_LITERAL_IF): Update test. Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests/m4sh.at')
-rw-r--r--tests/m4sh.at36
1 files changed, 28 insertions, 8 deletions
diff --git a/tests/m4sh.at b/tests/m4sh.at
index 05cea853..5b3a55db 100644
--- a/tests/m4sh.at
+++ b/tests/m4sh.at
@@ -1077,20 +1077,31 @@ AT_CLEANUP
## --------------- ##
AT_SETUP([AS@&t@_LITERAL_IF])
-AT_KEYWORDS([m4sh])
+AT_KEYWORDS([m4sh AS@&t@_LITERAL_WORD_IF])
AT_DATA_M4SH([script.as], [[dnl
AS_INIT
echo AS_LITERAL_IF([lit], [ok], [ERR]) 1
-echo AS_LITERAL_IF([l$it], [ERR], [ok]) 2
-echo AS_LITERAL_IF([l`case a in b) ;; esac`it], [ERR], [ok]) 3
-m4_define([mac], [lit])
-echo AS_LITERAL_IF([mac], [ok], [ERR]) 4
-echo AS_LITERAL_IF([mac($, ``)], [ok], [ERR]) 5
+echo AS_LITERAL_IF([l-/.it], [ok], [ERR]) 2
+echo AS_LITERAL_IF([l''it], [ERR], [ok]) 3
+echo AS_LITERAL_IF([l$it], [ERR], [ok]) 4
+echo AS_LITERAL_IF([l$it], [ERR1], [ok], [fixme]) 5
+echo AS_LITERAL_IF([l${it}], [ERR1], [ok], [fixme]) 6
+echo AS_LITERAL_IF([l`case a in b) ;; esac`it], [ERR], [ok]) 7
+echo AS_LITERAL_IF([l`case a in b) ;; esac`it], [ERR1], [ok], [ERR2]) 8
+m4_define([mac], [l-/.it])
+echo AS_LITERAL_IF([mac], [ok], [ERR]) 9
+echo AS_LITERAL_IF([mac($, ``)], [ok], [ERR]) 10
m4_define([mac], [l$it])
-echo AS_LITERAL_IF([mac], [ERR], [ok]) 6
+echo AS_LITERAL_IF([mac], [ERR], [ok]) 11
+echo AS_LITERAL_IF([mac], [ERR1], [ok], [fixme]) 12
m4_define([mac], [l``it])
-echo AS_LITERAL_IF([mac], [ERR], [ok]) 7
+echo AS_LITERAL_IF([mac], [ERR], [ok]) 13
+echo AS_LITERAL_IF([mac], [ERR1], [ok], [ERR2]) 14
+echo AS_LITERAL_IF([ a ][
+b], [ok], [ok]) 15
+echo AS_LITERAL_WORD_IF([ a ][
+b], [ERR], [ok]) 16
]])
AT_CHECK_M4SH
@@ -1102,6 +1113,15 @@ ok 4
ok 5
ok 6
ok 7
+ok 8
+ok 9
+ok 10
+ok 11
+ok 12
+ok 13
+ok 14
+ok 15
+ok 16
]])
AT_CLEANUP