tests/make: show that '||' and '&&' must be preceded by whitespace

This commit is contained in:
rillig 2023-08-15 21:27:09 +00:00
parent 95f204a973
commit 62bde11359
2 changed files with 14 additions and 6 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: cond-op-and.mk,v 1.7 2023/06/01 20:56:35 rillig Exp $
# $NetBSD: cond-op-and.mk,v 1.8 2023/08/15 21:27:09 rillig Exp $
#
# Tests for the && operator in .if conditions.
@ -76,5 +76,9 @@ DEF= defined
. error
.endif
all:
@:;
# The '&&' operator must be preceded by whitespace, otherwise it becomes part
# of the preceding bare word. The condition is parsed as '"1&&" != "" && 1'.
.if 1&& && 1
.else
. error
.endif

View File

@ -1,4 +1,4 @@
# $NetBSD: cond-op-or.mk,v 1.9 2023/06/01 20:56:35 rillig Exp $
# $NetBSD: cond-op-or.mk,v 1.10 2023/08/15 21:27:09 rillig Exp $
#
# Tests for the || operator in .if conditions.
@ -76,5 +76,9 @@ DEF= defined
. error
.endif
all:
@:;
# The '||' operator must be preceded by whitespace, otherwise it becomes part
# of the preceding bare word. The condition is parsed as '"1||" != "" || 0'.
.if 1|| || 0
.else
. error
.endif