Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make/unit-tests Our practice is that an even number ...



details:   https://anonhg.NetBSD.org/src/rev/f2239b5f839c
branches:  trunk
changeset: 801935:f2239b5f839c
user:      apb <apb%NetBSD.org@localhost>
date:      Sun Aug 24 16:08:14 2014 +0000

description:
Our practice is that an even number of backslashes before a newline
in a variable assignment simply stores the backslashes as part of the
value, and treats the newline as though it was not escaped.  This
is compatible with GNU make.

diffstat:

 usr.bin/make/unit-tests/escape.exp |  14 +++++++-------
 usr.bin/make/unit-tests/escape.mk  |  13 ++++++++-----
 2 files changed, 15 insertions(+), 12 deletions(-)

diffs (68 lines):

diff -r 610938293cae -r f2239b5f839c usr.bin/make/unit-tests/escape.exp
--- a/usr.bin/make/unit-tests/escape.exp        Sun Aug 24 15:10:13 2014 +0000
+++ b/usr.bin/make/unit-tests/escape.exp        Sun Aug 24 16:08:14 2014 +0000
@@ -23,13 +23,13 @@
 VAR1BSNLc=:111:
 VAR1BSNLsc=:111:
 var-2bsnl
-VAR2BSNL=:222\ 222=:
-VAR2BSNLa=:222\ aaa=:
-VAR2BSNLA=:222\ aaa=:
-VAR2BSNLda=:222\ ${a}=:
-VAR2BSNLdA=:222\ ${A}=:
-VAR2BSNLc=:222\:
-VAR2BSNLsc=:222\:
+VAR2BSNL=:222\\:
+VAR2BSNLa=:222\\:
+VAR2BSNLA=:222\\:
+VAR2BSNLda=:222\\:
+VAR2BSNLdA=:222\\:
+VAR2BSNLc=:222\\:
+VAR2BSNLsc=:222\\:
 var-3bsnl
 VAR3BSNL=:333\\ 333=:
 VAR3BSNLa=:333\\ aaa=:
diff -r 610938293cae -r f2239b5f839c usr.bin/make/unit-tests/escape.mk
--- a/usr.bin/make/unit-tests/escape.mk Sun Aug 24 15:10:13 2014 +0000
+++ b/usr.bin/make/unit-tests/escape.mk Sun Aug 24 16:08:14 2014 +0000
@@ -1,4 +1,4 @@
-# $Id: escape.mk,v 1.6 2014/08/24 15:10:13 apb Exp $
+# $Id: escape.mk,v 1.7 2014/08/24 16:08:14 apb Exp $
 #
 # Test backslash escaping.
 
@@ -31,6 +31,11 @@
 # Our practice, despite what POSIX might say, is that "\#"
 # in a variable assignment stores "#" as part of the value.
 # The "\" is not taken literally, and the "#" does not begin a comment.
+#
+# Also, our practice is that an even number of backslashes before a newline
+# in a variable assignment simply stores the backslashes as part of the
+# value, and treats the newline as though it was not escaped.  This
+# is compatible with GNU make.
 
 all: .PHONY
 # We will add dependencies like "all: yet-another-test" later.
@@ -100,8 +105,7 @@
        VAR1BSNLc VAR1BSNLsc
 
 # Double-backslash-newline in a variable setting.
-# First one should be taken literally, and last should escape the newline.
-# XXX: Is the expected behaviour well defined?
+# Both backslashes should be taken literally, and the newline is NOT escaped.
 #
 # The second lines below each end with '=' so that they will not
 # generate syntax errors regardless of whether or not they are
@@ -125,11 +129,10 @@
 all: var-2bsnl
 var-2bsnl: .PHONY __printvars \
        VAR2BSNL VAR2BSNLa VAR2BSNLA VAR2BSNLda VAR2BSNLdA \
-       VAR2BSNLc VARR2BSNLsc
+       VAR2BSNLc VAR2BSNLsc
 
 # Triple-backslash-newline in a variable setting.
 # First two should be taken literally, and last should escape the newline.
-# XXX: Is the expected behaviour well defined?
 #
 # The second lines below each end with '=' so that they will not
 # generate syntax errors regardless of whether or not they are



Home | Main Index | Thread Index | Old Index