diff options
Diffstat (limited to 'unit-tests/cond-short.mk')
-rw-r--r-- | unit-tests/cond-short.mk | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/unit-tests/cond-short.mk b/unit-tests/cond-short.mk index ae441d80f7d9..9e3b0575eb78 100644 --- a/unit-tests/cond-short.mk +++ b/unit-tests/cond-short.mk @@ -1,4 +1,4 @@ -# $NetBSD: cond-short.mk,v 1.9 2020/08/19 22:47:09 rillig Exp $ +# $NetBSD: cond-short.mk,v 1.11 2020/10/24 08:50:17 rillig Exp $ # # Demonstrates that in conditions, the right-hand side of an && or || # is only evaluated if it can actually influence the result. @@ -76,7 +76,7 @@ VAR= # empty again, for the following tests .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} +. warning first=${FIRST} last=${LAST} appended=${APPENDED} ran=${RAN} .endif # The || operator. @@ -113,59 +113,59 @@ VAR= # empty again, for the following tests # make sure these do not cause complaint #.MAKEFLAGS: -dc -V42 = 42 -iV1 = ${V42} -iV2 = ${V66} +V42= 42 +iV1= ${V42} +iV2= ${V66} .if defined(V42) && ${V42} > 0 -x=Ok +x= Ok .else -x=Fail +x= Fail .endif -x!= echo 'defined(V42) && ${V42} > 0: $x' >&2; echo +x!= echo 'defined(V42) && ${V42} > 0: $x' >&2; echo # this one throws both String comparison operator and # Malformed conditional with cond.c 1.78 # indirect iV2 would expand to "" and treated as 0 .if defined(V66) && ( ${iV2} < ${V42} ) -x=Fail +x= Fail .else -x=Ok +x= Ok .endif -x!= echo 'defined(V66) && ( "${iV2}" < ${V42} ): $x' >&2; echo +x!= echo 'defined(V66) && ( "${iV2}" < ${V42} ): $x' >&2; echo # next two thow String comparison operator with cond.c 1.78 # indirect iV1 would expand to 42 .if 1 || ${iV1} < ${V42} -x=Ok +x= Ok .else -x=Fail +x= Fail .endif -x!= echo '1 || ${iV1} < ${V42}: $x' >&2; echo +x!= echo '1 || ${iV1} < ${V42}: $x' >&2; echo .if 1 || ${iV2:U2} < ${V42} -x=Ok +x= Ok .else -x=Fail +x= Fail .endif -x!= echo '1 || ${iV2:U2} < ${V42}: $x' >&2; echo +x!= echo '1 || ${iV2:U2} < ${V42}: $x' >&2; echo # the same expressions are fine when the lhs is expanded # ${iV1} expands to 42 .if 0 || ${iV1} <= ${V42} -x=Ok +x= Ok .else -x=Fail +x= Fail .endif -x!= echo '0 || ${iV1} <= ${V42}: $x' >&2; echo +x!= echo '0 || ${iV1} <= ${V42}: $x' >&2; echo # ${iV2:U2} expands to 2 .if 0 || ${iV2:U2} < ${V42} -x=Ok +x= Ok .else -x=Fail +x= Fail .endif -x!= echo '0 || ${iV2:U2} < ${V42}: $x' >&2; echo +x!= echo '0 || ${iV2:U2} < ${V42}: $x' >&2; echo all: @:;: |