Module Name:    src
Committed By:   rillig
Date:           Thu Nov 12 19:45:24 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: directive-elif.exp directive-elif.mk

Log Message:
make(1): add test for missing space after .if directive


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/directive-elif.exp
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/directive-elif.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/directive-elif.exp
diff -u src/usr.bin/make/unit-tests/directive-elif.exp:1.3 src/usr.bin/make/unit-tests/directive-elif.exp:1.4
--- src/usr.bin/make/unit-tests/directive-elif.exp:1.3	Tue Nov 10 22:23:37 2020
+++ src/usr.bin/make/unit-tests/directive-elif.exp	Thu Nov 12 19:45:24 2020
@@ -12,6 +12,9 @@ make: "directive-elif.mk" line 57: Unkno
 make: "directive-elif.mk" line 58: 2-elsif
 make: "directive-elif.mk" line 64: if-less elif
 make: "directive-elif.mk" line 69: warning: extra elif
+make: "directive-elif.mk" line 75: Don't do this, always put a space after a directive.
+make: "directive-elif.mk" line 79: Don't do this, always put a space after a directive.
+make: "directive-elif.mk" line 85: Don't do this, always put a space around comparison operators.
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/directive-elif.mk
diff -u src/usr.bin/make/unit-tests/directive-elif.mk:1.4 src/usr.bin/make/unit-tests/directive-elif.mk:1.5
--- src/usr.bin/make/unit-tests/directive-elif.mk:1.4	Tue Nov 10 22:23:37 2020
+++ src/usr.bin/make/unit-tests/directive-elif.mk	Thu Nov 12 19:45:24 2020
@@ -1,4 +1,4 @@
-# $NetBSD: directive-elif.mk,v 1.4 2020/11/10 22:23:37 rillig Exp $
+# $NetBSD: directive-elif.mk,v 1.5 2020/11/12 19:45:24 rillig Exp $
 #
 # Tests for the .elif directive.
 
@@ -69,5 +69,22 @@
 .elif
 .endif
 
+.if0
+.  error
+.else
+.  info Don't do this, always put a space after a directive.
+.endif
+
+.if${:U-3}
+.  info Don't do this, always put a space after a directive.
+.else
+.  error
+.endif
+
+.if${:U-3}>-4
+.  info Don't do this, always put a space around comparison operators.
+.else
+.  error
+.endif
+
 all:
-	@:;

Reply via email to