summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog5
-rw-r--r--tests/scripts/misc/bs-nl56
2 files changed, 46 insertions, 15 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 7ad4085..210dfb2 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-03 Paul Smith <psmith@gnu.org>
+
+ * scripts/misc/bs-nl: Check for POSIX and non-POSIX
+ backslash/newline handling. Addresses Savannah bug #16670.
+
2012-01-29 Paul Smith <psmith@gnu.org>
* scripts/variables/flavors: Add tests for ::=
diff --git a/tests/scripts/misc/bs-nl b/tests/scripts/misc/bs-nl
index 979abb5..e27a3f7 100644
--- a/tests/scripts/misc/bs-nl
+++ b/tests/scripts/misc/bs-nl
@@ -50,27 +50,53 @@ run_make_test("squote:;\@echo 'squ\\\n\t\t ote'\n",
# Backslash-newlines in variable values
# Simple
-run_make_test("
-var = he\\\nllo
-var:;\@echo '|\$(var)|'",
+run_make_test(q!
+var = he\
+llo
+var:;@echo '|$(var)|'!,
'', "|he llo|");
-# Preserve preceding space
-run_make_test("
-var = he \\\nllo
-var:;\@echo '|\$(var)|'",
- '', "|he llo|");
+# Condense trailing space
+run_make_test(q!
+var = he \
+llo
+var:;@echo '|$(var)|'!,
+ '', "|he llo|");
# Remove leading space
-run_make_test("
-var = he\\\n llo
-var:;\@echo '|\$(var)|'",
+run_make_test(q!
+var = he\
+ llo
+var:;@echo '|$(var)|'!,
+ '', "|he llo|");
+
+# Multiple bs/nl condensed
+run_make_test(q!
+var = he\
+\
+\
+ llo
+var:;@echo '|$(var)|'!,
'', "|he llo|");
-# One space per bs-nl
-run_make_test("
-var = he\\\n\\\n\\\n llo
-var:;\@echo '|\$(var)|'",
+# POSIX: Preserve trailing space
+run_make_test(q!
+.POSIX:
+x = y
+var = he \
+llo
+var:;@echo '|$(var)|'!,
+ '', "|he llo|");
+
+# POSIX: One space per bs-nl
+run_make_test(q!
+.POSIX:
+x = y
+var = he\
+\
+\
+ llo
+var:;@echo '|$(var)|'!,
'', "|he llo|");
1;