diff options
Diffstat (limited to 'contrib/bmake/unit-tests/cond-undef-lint.mk')
-rwxr-xr-x | contrib/bmake/unit-tests/cond-undef-lint.mk | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/contrib/bmake/unit-tests/cond-undef-lint.mk b/contrib/bmake/unit-tests/cond-undef-lint.mk index 9dfd1bd53252..6fd353dc60e2 100755 --- a/contrib/bmake/unit-tests/cond-undef-lint.mk +++ b/contrib/bmake/unit-tests/cond-undef-lint.mk @@ -1,4 +1,4 @@ -# $NetBSD: cond-undef-lint.mk,v 1.3 2020/11/15 14:58:14 rillig Exp $ +# $NetBSD: cond-undef-lint.mk,v 1.4 2023/06/01 20:56:35 rillig Exp $ # # Tests for defined and undefined variables in .if conditions, in lint mode. # @@ -20,6 +20,8 @@ DEF= defined .endif # Since the condition fails to evaluate, neither of the branches is taken. +# expect+2: Malformed conditional (${UNDEF}) +# expect+1: Variable "UNDEF" is undefined .if ${UNDEF} . error .else @@ -35,6 +37,9 @@ DEF= defined # # TODO: Suppress the error message "Variable VAR. is undefined". That part # of the expression must not be evaluated at all. +# expect+3: Variable "UNDEF" is undefined +# expect+2: Variable "VAR." is undefined +# expect+1: Malformed conditional (${VAR.${UNDEF}}) .if ${VAR.${UNDEF}} . error .else @@ -46,6 +51,8 @@ DEF= defined # TODO: This pattern looks a lot like CFLAGS.${OPSYS}, which is at least # debatable. Or would any practical use of CFLAGS.${OPSYS} be via an indirect # expression, as in the next example? +# expect+2: Variable "VAR.defined" is undefined +# expect+1: Malformed conditional (${VAR.${DEF}}) .if ${VAR.${DEF}} . error .else |