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 tests/make: demonstrate another path...



details:   https://anonhg.NetBSD.org/src/rev/0098f6f0f5d2
branches:  trunk
changeset: 366723:0098f6f0f5d2
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jun 11 07:54:25 2022 +0000

description:
tests/make: demonstrate another pathological pattern match

diffstat:

 usr.bin/make/unit-tests/varmod-match.exp |   5 +++--
 usr.bin/make/unit-tests/varmod-match.mk  |  11 ++++++++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diffs (47 lines):

diff -r c916df5cafe6 -r 0098f6f0f5d2 usr.bin/make/unit-tests/varmod-match.exp
--- a/usr.bin/make/unit-tests/varmod-match.exp  Sat Jun 11 04:57:57 2022 +0000
+++ b/usr.bin/make/unit-tests/varmod-match.exp  Sat Jun 11 07:54:25 2022 +0000
@@ -5,12 +5,13 @@
 CondParser_Eval: ${NUMBERS:M[^s]*[ex]} != "One Three five"
 Comparing "One Three five" != "One Three five"
 CondParser_Eval: ${:U****************:M****************b}
+CondParser_Eval: ${:U..................................................b:M*?*?*?*?*?a}
 CondParser_Eval: ${:Ua \$ sign:M*$$*} != "\$"
 Comparing "$" != "$"
 CondParser_Eval: ${:Ua \$ sign any-asterisk:M*\$*} != "any-asterisk"
 Comparing "any-asterisk" != "any-asterisk"
-make: "varmod-match.mk" line 146: Unknown modifier "]"
-make: "varmod-match.mk" line 146: Malformed conditional (${ ${:U\:} ${:U\:\:} :L:M[:]} != ":")
+make: "varmod-match.mk" line 151: Unknown modifier "]"
+make: "varmod-match.mk" line 151: Malformed conditional (${ ${:U\:} ${:U\:\:} :L:M[:]} != ":")
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
diff -r c916df5cafe6 -r 0098f6f0f5d2 usr.bin/make/unit-tests/varmod-match.mk
--- a/usr.bin/make/unit-tests/varmod-match.mk   Sat Jun 11 04:57:57 2022 +0000
+++ b/usr.bin/make/unit-tests/varmod-match.mk   Sat Jun 11 07:54:25 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-match.mk,v 1.9 2022/05/08 06:51:27 rillig Exp $
+# $NetBSD: varmod-match.mk,v 1.10 2022/06/11 07:54:25 rillig Exp $
 #
 # Tests for the :M variable modifier, which filters words that match the
 # given pattern.
@@ -28,11 +28,16 @@
 .  error
 .endif
 
-# Before 2020-06-13, this expression took quite a long time in Str_Match,
-# calling itself 601080390 times for 16 asterisks.
+# Before 2020-06-13, this expression called Str_Match 601,080,390 times.
+# Since 2020-06-13, this expression calls Str_Match 1 time.
 .if ${:U****************:M****************b}
 .endif
 
+# As of 2022-06-11, this expression calls Str_Match 5,242,223 times.
+# Adding another '*?' to the pattern calls Str_Match 41,261,143 times.
+.if ${:U..................................................b:M*?*?*?*?*?a}
+.endif
+
 # To match a dollar sign in a word, double it.
 #
 # This is different from the :S and :C variable modifiers, where a '$'



Home | Main Index | Thread Index | Old Index