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): add test for inconsistent i...



details:   https://anonhg.NetBSD.org/src/rev/7e1815799530
branches:  trunk
changeset: 936690:7e1815799530
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 01 18:59:16 2020 +0000

description:
make(1): add test for inconsistent interpretation of :M and :N modifiers

diffstat:

 usr.bin/make/unit-tests/modmatch.mk |  18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diffs (29 lines):

diff -r d4b4aed1ce7b -r 7e1815799530 usr.bin/make/unit-tests/modmatch.mk
--- a/usr.bin/make/unit-tests/modmatch.mk       Sat Aug 01 18:36:49 2020 +0000
+++ b/usr.bin/make/unit-tests/modmatch.mk       Sat Aug 01 18:59:16 2020 +0000
@@ -1,3 +1,6 @@
+# $NetBSD: modmatch.mk,v 1.7 2020/08/01 18:59:16 rillig Exp $
+#
+# Tests for the :M and :S modifiers.
 
 X=a b c d e
 
@@ -37,3 +40,18 @@
 # calling itself 601080390 times for 16 asterisks.
 slow: .PHONY
        @:;: ${:U****************:M****************b:Q}
+
+# As of 2020-08-01, the :M and :N modifiers interpret backslashes differently,
+# depending on whether there was a variable expression before the first
+# backslash or not.  This can be seen by setting the -dv debug flag, in the
+# lines starting with "Pattern".
+#
+# Apart from the different and possibly confusing debug output, there is no
+# difference in behavior.  When parsing the modifier text, only \{, \} and \:
+# are unescaped, and in the pattern matching these have the same meaning as
+# their plain variants '{', '}' and ':'.  In the pattern matching from
+# Str_Match, only \*, \? or \[ would make a noticeable difference.
+SPECIALS=      \: : \\ * \*
+.if ${SPECIALS:M${:U}\:} != ${SPECIALS:M\:${:U}}
+.warning unexpected
+.endif



Home | Main Index | Thread Index | Old Index