Imported from ../bash-3.1.tar.gz.
[platform/upstream/bash.git] / tests / nquote.tests
index a2e596b..b25fbe3 100644 (file)
@@ -6,6 +6,11 @@ expect()
 expect '<^J^J^J>'
 recho $'\n\n\n'
 
+expect '<++^J++>'
+f=$'\n'
+recho "++$f++"
+unset f
+
 z1=$''
 expect '<>'
 recho "$z1"
@@ -55,3 +60,43 @@ recho \$"hello, $world"
 
 expect '<hello, chet>'
 recho $"hello, $world"
+
+z=$'\v\f\a\b'
+case "$z" in
+$'\v\f\a\b')   echo ok;;
+*)             echo bad;;
+esac
+
+# Dave Korn says this should be allowed and echo 'abcd'
+echo $'\'abcd\''
+
+# printf translates \' to ' ...
+printf "\'abcd\'\n"
+
+# but echo -e doesn't
+echo -e "\'abcd\'"
+echo -e "\\'abcd\\'"
+
+# and what do we do about unrecognized escape sequences?
+
+shopt -s xpg_echo
+
+recho $'A\CB'
+
+recho "A\CB"
+
+cde=c
+recho $'ab$cde'
+
+printf "%b\n" 'A\CB'
+printf 'A\CB\n'
+
+echo 'A\CB'
+
+world=chet
+
+recho $'hello, $"world"'
+recho $'hello, \$"world"'
+recho $'hello, $\"world"'
+
+recho "hello, $"world""