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: fix test for modifier ':...



details:   https://anonhg.NetBSD.org/src/rev/065205bb56da
branches:  trunk
changeset: 961217:065205bb56da
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Apr 12 16:09:57 2021 +0000

description:
tests/make: fix test for modifier ':from=to'

I had forgotten to remove the single quotes, to produce a really empty
word.  Plus I had forgotten the modifier ':Q' for the result, which
meant that the single quotes did not show up in the output.

diffstat:

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

diffs (78 lines):

diff -r d893e51d12fa -r 065205bb56da usr.bin/make/unit-tests/varmod-sysv.exp
--- a/usr.bin/make/unit-tests/varmod-sysv.exp   Mon Apr 12 16:04:30 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-sysv.exp   Mon Apr 12 16:09:57 2021 +0000
@@ -5,23 +5,23 @@
 suffix                   =                        "suffix"
 prefix                   =                        "prefix"
 pre-middle-suffix        =                        "pre-middle-suffix"
-''                       =NS                      "NS"
+''                       =NS                      ""
 suffix                   =NS                      "suffixNS"
 prefix                   =NS                      "prefixNS"
 pre-middle-suffix        =NS                      "pre-middle-suffixNS"
-''                       =%                       "%"
+''                       =%                       ""
 suffix                   =%                       "suffix%"
 prefix                   =%                       "prefix%"
 pre-middle-suffix        =%                       "pre-middle-suffix%"
-''                       =%NS                     "%NS"
+''                       =%NS                     ""
 suffix                   =%NS                     "suffix%NS"
 prefix                   =%NS                     "prefix%NS"
 pre-middle-suffix        =%NS                     "pre-middle-suffix%NS"
-''                       =NPre%                   "NPre%"
+''                       =NPre%                   ""
 suffix                   =NPre%                   "suffixNPre%"
 prefix                   =NPre%                   "prefixNPre%"
 pre-middle-suffix        =NPre%                   "pre-middle-suffixNPre%"
-''                       =NPre%NS                 "NPre%NS"
+''                       =NPre%NS                 ""
 suffix                   =NPre%NS                 "suffixNPre%NS"
 prefix                   =NPre%NS                 "prefixNPre%NS"
 pre-middle-suffix        =NPre%NS                 "pre-middle-suffixNPre%NS"
@@ -53,7 +53,7 @@
 suffix                   %=                       ""
 prefix                   %=                       ""
 pre-middle-suffix        %=                       ""
-''                       %=NS                     "NS"
+''                       %=NS                     ""
 suffix                   %=NS                     "NS"
 prefix                   %=NS                     "NS"
 pre-middle-suffix        %=NS                     "NS"
@@ -61,15 +61,15 @@
 suffix                   %=%                      "suffix"
 prefix                   %=%                      "prefix"
 pre-middle-suffix        %=%                      "pre-middle-suffix"
-''                       %=%NS                    "NS"
+''                       %=%NS                    ""
 suffix                   %=%NS                    "suffixNS"
 prefix                   %=%NS                    "prefixNS"
 pre-middle-suffix        %=%NS                    "pre-middle-suffixNS"
-''                       %=NPre%                  "NPre"
+''                       %=NPre%                  ""
 suffix                   %=NPre%                  "NPresuffix"
 prefix                   %=NPre%                  "NPreprefix"
 pre-middle-suffix        %=NPre%                  "NPrepre-middle-suffix"
-''                       %=NPre%NS                "NPreNS"
+''                       %=NPre%NS                ""
 suffix                   %=NPre%NS                "NPresuffixNS"
 prefix                   %=NPre%NS                "NPreprefixNS"
 pre-middle-suffix        %=NPre%NS                "NPrepre-middle-suffixNS"
diff -r d893e51d12fa -r 065205bb56da usr.bin/make/unit-tests/varmod-sysv.mk
--- a/usr.bin/make/unit-tests/varmod-sysv.mk    Mon Apr 12 16:04:30 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-sysv.mk    Mon Apr 12 16:09:57 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-sysv.mk,v 1.13 2021/04/12 16:04:30 rillig Exp $
+# $NetBSD: varmod-sysv.mk,v 1.14 2021/04/12 16:09:57 rillig Exp $
 #
 # Tests for the variable modifier ':from=to', which replaces the suffix
 # "from" with "to".  It can also use '%' as a wildcard.
@@ -245,7 +245,7 @@
 .  for to in '' NS % %NS NPre% NPre%NS
 .    for word in '' suffix prefix pre-middle-suffix
 .      for mod in ${from:N''}=${to:N''}
-!=1>&2 printf '%-24s %-24s "%s"\n' ''${word:Q} ''${mod:Q} ''${word:${mod}}
+!=1>&2 printf '%-24s %-24s "%s"\n' ''${word:Q} ''${mod:Q} ''${word:N'':${mod}:Q}
 .      endfor
 .    endfor
 .  endfor



Home | Main Index | Thread Index | Old Index