summaryrefslogtreecommitdiff
path: root/tests/scripts/misc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scripts/misc')
-rw-r--r--tests/scripts/misc/bs-nl56
1 files changed, 41 insertions, 15 deletions
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;