aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/directive-if.mk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bmake/unit-tests/directive-if.mk')
-rw-r--r--contrib/bmake/unit-tests/directive-if.mk12
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/bmake/unit-tests/directive-if.mk b/contrib/bmake/unit-tests/directive-if.mk
index 1acd5c958008..7ff04da0755b 100644
--- a/contrib/bmake/unit-tests/directive-if.mk
+++ b/contrib/bmake/unit-tests/directive-if.mk
@@ -1,4 +1,4 @@
-# $NetBSD: directive-if.mk,v 1.11 2022/01/23 21:48:59 rillig Exp $
+# $NetBSD: directive-if.mk,v 1.13 2024/08/06 18:00:17 rillig Exp $
#
# Tests for the .if directive.
#
@@ -10,10 +10,12 @@
.if 0
. error
.else
+# expect+1: 0 evaluates to false.
. info 0 evaluates to false.
.endif
.if 1
+# expect+1: 1 evaluates to true.
. info 1 evaluates to true.
.else
. error
@@ -49,7 +51,7 @@
.endif
# Missing condition.
-# expect+1: Malformed conditional ()
+# expect+1: Malformed conditional ''
.if
. error
.else
@@ -60,6 +62,7 @@
# though, which are kept. The quotes need not be balanced. The next space
# ends the word, and the remaining " || 1" is parsed as "or true".
.if ${:Uplain"""""} == plain""""" || 1
+# expect+1: Quotes in plain words are probably a mistake.
. info Quotes in plain words are probably a mistake.
# XXX: Accepting quotes in plain words is probably a mistake as well.
.else
@@ -69,26 +72,31 @@
.if0
. error
.else
+# expect+1: Don't do this, always put a space after a directive.
. info Don't do this, always put a space after a directive.
.endif
.if${:U-3}
+# expect+1: Don't do this, always put a space after a directive.
. info Don't do this, always put a space after a directive.
.else
. error
.endif
.if${:U-3}>-4
+# expect+1: Don't do this, always put a space around comparison operators.
. info Don't do this, always put a space around comparison operators.
.else
. error
.endif
.if(1)
+# expect+1: Don't do this, always put a space after a directive.
. info Don't do this, always put a space after a directive.
.endif
.if!0
+# expect+1: Don't do this, always put a space after a directive.
. info Don't do this, always put a space after a directive.
.endif