summaryrefslogtreecommitdiff
path: root/shell/ash_test/ash-quoting
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash_test/ash-quoting')
-rw-r--r--shell/ash_test/ash-quoting/dollar_altvalue2.right69
-rwxr-xr-xshell/ash_test/ash-quoting/dollar_altvalue2.tests33
-rw-r--r--shell/ash_test/ash-quoting/dollar_altvalue9.right2
3 files changed, 104 insertions, 0 deletions
diff --git a/shell/ash_test/ash-quoting/dollar_altvalue2.right b/shell/ash_test/ash-quoting/dollar_altvalue2.right
new file mode 100644
index 0000000..7cf37e3
--- /dev/null
+++ b/shell/ash_test/ash-quoting/dollar_altvalue2.right
@@ -0,0 +1,69 @@
+Unquoted '':
+start:
+||
+end
+start:
+||
+end
+start:
+||
+end
+start:
+||
+end
+start:
+||
+||
+end
+
+Unquoted "":
+start:
+||
+end
+start:
+||
+end
+start:
+||
+end
+start:
+||
+end
+start:
+||
+||
+end
+
+Quoted '':
+start:
+|''|
+end
+start:
+|'' |
+end
+start:
+| ''|
+end
+start:
+| '' |
+end
+start:
+|'' ''|
+end
+
+Quoted "":
+start:
+||
+end
+start:
+| |
+end
+start:
+| |
+end
+start:
+| |
+end
+start:
+| |
+end
diff --git a/shell/ash_test/ash-quoting/dollar_altvalue2.tests b/shell/ash_test/ash-quoting/dollar_altvalue2.tests
new file mode 100755
index 0000000..3377eb2
--- /dev/null
+++ b/shell/ash_test/ash-quoting/dollar_altvalue2.tests
@@ -0,0 +1,33 @@
+f() { echo start:; for i; do echo "|$i|"; done; echo end; }
+x=a
+
+echo "Unquoted '':"
+f ${x:+''}
+f ${x:+'' }
+f ${x:+ ''}
+f ${x:+ '' }
+f ${x:+'' ''}
+
+echo
+echo 'Unquoted "":'
+f ${x:+""}
+f ${x:+"" }
+f ${x:+ ""}
+f ${x:+ "" }
+f ${x:+"" ""}
+
+echo
+echo "Quoted '':"
+f "${x:+''}"
+f "${x:+'' }"
+f "${x:+ ''}"
+f "${x:+ '' }"
+f "${x:+'' ''}"
+
+echo
+echo 'Quoted "":'
+f "${x:+""}"
+f "${x:+"" }"
+f "${x:+ ""}"
+f "${x:+ "" }"
+f "${x:+"" ""}"
diff --git a/shell/ash_test/ash-quoting/dollar_altvalue9.right b/shell/ash_test/ash-quoting/dollar_altvalue9.right
index fc6c269..39342fe 100644
--- a/shell/ash_test/ash-quoting/dollar_altvalue9.right
+++ b/shell/ash_test/ash-quoting/dollar_altvalue9.right
@@ -3,6 +3,7 @@ Unquoted 1:
|x y|
|1|
|2|
+||
|1 2|
|A|
|B|
@@ -14,6 +15,7 @@ Unquoted 2:
|ax y|
|1|
|2|
+||
|1 2|
|A|
|B|