Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make/unit-tests make(1): fix comments in test for th...



details:   https://anonhg.NetBSD.org/src/rev/21ccec8bdefc
branches:  trunk
changeset: 943904:21ccec8bdefc
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Sep 13 05:36:26 2020 +0000

description:
make(1): fix comments in test for the :M variable modifier

One mistake per sentence is pretty much, I must have been quite
unconcentrated.

The other commits from around that time are fine though.

diffstat:

 usr.bin/make/unit-tests/varmod-match.mk |  23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diffs (57 lines):

diff -r 606cbe5a2656 -r 21ccec8bdefc usr.bin/make/unit-tests/varmod-match.mk
--- a/usr.bin/make/unit-tests/varmod-match.mk   Sun Sep 13 04:14:48 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-match.mk   Sun Sep 13 05:36:26 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-match.mk,v 1.4 2020/09/12 22:35:43 rillig Exp $
+# $NetBSD: varmod-match.mk,v 1.5 2020/09/13 05:36:26 rillig Exp $
 #
 # Tests for the :M variable modifier, which filters words that match the
 # given pattern.
@@ -9,18 +9,21 @@
 
 NUMBERS=       One Two Three Four five six seven
 
-# Only keep numbers that start with an uppercase letter.
+# Only keep words that start with an uppercase letter.
 .if ${NUMBERS:M[A-Z]*} != "One Two Three Four"
 .  error
 .endif
 
-# Only keep numbers that don't start with an uppercase letter.
+# Only keep words that start with a character other than an uppercase letter.
 .if ${NUMBERS:M[^A-Z]*} != "five six seven"
 .  error
 .endif
 
-# Only keep numbers that don't start with s and at the same time
-# ends with either of [ex].
+# Only keep words that don't start with s and at the same time end with
+# either of [ex].
+#
+# This test case ensures that the negation from the first character class
+# does not propagate to the second character class.
 .if ${NUMBERS:M[^s]*[ex]} != "One Three five"
 .  error
 .endif
@@ -31,14 +34,18 @@
 .endif
 
 # To match a dollar sign in a word, double it.
+#
 # This is different from the :S and :C variable modifiers, where a '$'
-# has to be escaped as '$$'.
+# has to be escaped as '\$'.
 .if ${:Ua \$ sign:M*$$*} != "\$"
 .  error
 .endif
 
-# In the :M modifier, it does not work to escape a dollar using a backslash.
-# This is different from the :S, :C and a few other variable modifiers.
+# In the :M modifier, '\$' does not escape a dollar.  Instead it is
+# interpreted as a backslash followed by whatever expression the
+# '$' starts.
+#
+# This differs from the :S, :C and several other variable modifiers.
 ${:U*}=                asterisk
 .if ${:Ua \$ sign any-asterisk:M*\$*} != "any-asterisk"
 .  error



Home | Main Index | Thread Index | Old Index