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 assignment ope...



details:   https://anonhg.NetBSD.org/src/rev/462ac7a763b9
branches:  trunk
changeset: 936139:462ac7a763b9
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 19 21:03:55 2020 +0000

description:
make(1): add test for assignment operators in conditions

diffstat:

 usr.bin/make/unit-tests/cond-short.mk |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r 2866012d7f9c -r 462ac7a763b9 usr.bin/make/unit-tests/cond-short.mk
--- a/usr.bin/make/unit-tests/cond-short.mk     Sun Jul 19 20:56:34 2020 +0000
+++ b/usr.bin/make/unit-tests/cond-short.mk     Sun Jul 19 21:03:55 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cond-short.mk,v 1.7 2020/07/09 22:34:09 sjg Exp $
+# $NetBSD: cond-short.mk,v 1.8 2020/07/19 21:03:55 rillig Exp $
 #
 # Demonstrates that in conditions, the right-hand side of an && or ||
 # is only evaluated if it can actually influence the result.
@@ -66,6 +66,19 @@
 .if 0 && !empty(:U${:!echo "unexpected exclam modifier" 1>&2 !})
 .endif
 
+# Irrelevant assignment modifiers are skipped as well.
+.if 0 && ${1 2 3:L:@i@${FIRST::?=$i}@}
+.endif
+.if 0 && ${1 2 3:L:@i@${LAST::=$i}@}
+.endif
+.if 0 && ${1 2 3:L:@i@${APPENDED::+=$i}@}
+.endif
+.if 0 && ${echo.1 echo.2 echo.3:L:@i@${RAN::!=${i:C,.*,&; & 1>\&2,:S,., ,g}}@}
+.endif
+.if defined(FIRST) || defined(LAST) || defined(APPENDED) || defined(RAN)
+.warning first=${FIRST} last=${LAST} appended=${APPENDED} ran=${RAN}
+.endif
+
 # The || operator.
 
 .if 1 || ${echo "unexpected or" 1>&2 :L:sh}



Home | Main Index | Thread Index | Old Index