Module Name:    src
Committed By:   apb
Date:           Sun Aug 24 14:04:35 UTC 2014

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

Log Message:
Adjust tests to correct for the fact that end-of-line comments
in variable assignments should not be included in the value.

Also fix more typos.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/escape.exp
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/escape.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/escape.exp
diff -u src/usr.bin/make/unit-tests/escape.exp:1.1 src/usr.bin/make/unit-tests/escape.exp:1.2
--- src/usr.bin/make/unit-tests/escape.exp:1.1	Sun Aug 24 11:52:45 2014
+++ src/usr.bin/make/unit-tests/escape.exp	Sun Aug 24 14:04:35 2014
@@ -16,21 +16,21 @@ VAR1BSNLa=:111 aaa:
 VAR1BSNLA=:111 aaa:
 VAR1BSNLda=:111 ${a}:
 VAR1BSNLdA=:111 ${A}:
-VAR1BSNLc=:111 # this should not be a comment, it should be part of the value:
+VAR1BSNLc=:111:
 var-2bsnl
-VAR2BSNL=:222\ #222:
-VAR2BSNLa=:222\ #aaa:
-VAR2BSNLA=:222\ #aaa:
-VAR2BSNLda=:222\ #${a}:
-VAR2BSNLdA=:222\ #${A}:
-VAR2BSNLc=:222\ # this should not be a comment, it should be part of the value:
+VAR2BSNL=:222\ 222=:
+VAR2BSNLa=:222\ aaa=:
+VAR2BSNLA=:222\ aaa=:
+VAR2BSNLda=:222\ ${a}=:
+VAR2BSNLdA=:222\ ${A}=:
+VAR2BSNLc=:222\=:
 var-3bsnl
-VAR3BSNL=:333\\ #333:
-VAR3BSNLa=:333\\ #aaa:
-VAR3BSNLA=:333\\ #aaa:
-VAR3BSNLda=:333\\ #${a}:
-VAR3BSNLdA=:333\\ #${A}:
-VAR3BSNLc=:333\ # this should not be a comment, it should be part of the value:
+VAR3BSNL=:333\\ 333=:
+VAR3BSNLa=:333\\ aaa=:
+VAR3BSNLA=:333\\ aaa=:
+VAR3BSNLda=:333\\ ${a}=:
+VAR3BSNLdA=:333\\ ${A}=:
+VAR3BSNLc=:333\\:
 var-1bsnl-space
 VAR1BSNL00=:first line:
 VAR1BSNL0=:first line no space on second line:

Index: src/usr.bin/make/unit-tests/escape.mk
diff -u src/usr.bin/make/unit-tests/escape.mk:1.3 src/usr.bin/make/unit-tests/escape.mk:1.4
--- src/usr.bin/make/unit-tests/escape.mk:1.3	Sun Aug 24 13:11:49 2014
+++ src/usr.bin/make/unit-tests/escape.mk	Sun Aug 24 14:04:35 2014
@@ -1,4 +1,4 @@
-# $Id: escape.mk,v 1.3 2014/08/24 13:11:49 apb Exp $
+# $Id: escape.mk,v 1.4 2014/08/24 14:04:35 apb Exp $
 #
 # Test backslash escaping.
 
@@ -87,7 +87,7 @@ $${a}
 VAR1BSNLdA = 111\
 $${A}
 VAR1BSNLc = 111\
-# this should not be a comment, it should be part of the value
+# this should be processed as a comment
 
 all: var-1bsnl
 var-1bsnl:	.PHONY
@@ -103,22 +103,22 @@ var-1bsnl:	.PHONY
 # First one should be taken literally, and last should escape the newline.
 # XXX: Is the expected behaviour well defined?
 #
-# The second lines below start with '#' so they should not generate
-# syntax errors regardless of whether or not they are treated as
-# part of the value.
+# The second lines below each end with '=' so that they will not
+# generate syntax errors regardless of whether or not they are
+# treated as part of the value.
 #
 VAR2BSNL = 222\\
-#222
+222=
 VAR2BSNLa = 222\\
-#${a}
+${a}=
 VAR2BSNLA = 222\\
-#${A}
+${A}=
 VAR2BSNLda = 222\\
-#$${a}
+$${a}=
 VAR2BSNLdA = 222\\
-#$${A}
+$${A}=
 VAR2BSNLc = 222\\
-# this should not be a comment, it should be part of the value
+# this should be processed as a comment
 
 all: var-2bsnl
 var-2bsnl:	.PHONY
@@ -134,22 +134,22 @@ var-2bsnl:	.PHONY
 # First two should be taken literally, and last should escape the newline.
 # XXX: Is the expected behaviour well defined?
 #
-# The second lines below start with '#' so they should not generate
-# syntax errors regardless of whether or not they ar treated as
-# part of the value.
+# The second lines below each end with '=' so that they will not
+# generate syntax errors regardless of whether or not they are
+# treated as part of the value.
 #
 VAR3BSNL = 333\\\
-#333
+333=
 VAR3BSNLa = 333\\\
-#${a}
+${a}=
 VAR3BSNLA = 333\\\
-#${A}
+${A}=
 VAR3BSNLda = 333\\\
-#$${a}
+$${a}=
 VAR3BSNLdA = 333\\\
-#$${A}
+$${A}=
 VAR3BSNLc = 333\\\
-# this should not be a comment, it should be part of the value
+# this should be processed as a comment
 
 all: var-3bsnl
 var-3bsnl:	.PHONY
@@ -157,8 +157,8 @@ var-3bsnl:	.PHONY
 	@echo VAR3BSNL=:${VAR3BSNL:Q}:
 	@echo VAR3BSNLa=:${VAR3BSNLa:Q}:
 	@echo VAR3BSNLA=:${VAR3BSNLA:Q}:
-	@echo VAR3BSNLda=:${VAR3BSNLa:Q}:
-	@echo VAR3BSNLdA=:${VAR3BSNLA:Q}:
+	@echo VAR3BSNLda=:${VAR3BSNLda:Q}:
+	@echo VAR3BSNLdA=:${VAR3BSNLdA:Q}:
 	@echo VAR3BSNLc=:${VAR3BSNLc:Q}:
 
 # Backslash-newline in a variable setting, plus any amount of white space

Reply via email to