]> git.ipfire.org Git - thirdparty/bash.git/blobdiff - tests/exp.tests
Bash-4.4 patch 19
[thirdparty/bash.git] / tests / exp.tests
index 1f4a35b782d29034e2292618ab559b46941fcf8e..b446d6372a2f74085b54f14783acdacd2bbc5bc9 100644 (file)
@@ -22,14 +22,26 @@ expect "<^A>"
 recho `echo '\ 1'`
 expect "<^A>"
 recho `echo "\ 1"`
-expect "<^B>"
-recho `echo '\ 2'`
-expect "<^B>"
-recho `echo "\ 2"`
+expect "<^?>"
+recho `echo '\7f'`
+expect "<^?>"
+recho `echo "\7f"`
 expect "<^A>"
 recho `echo \ 1`
-expect "<^B>"
-recho `echo \ 2`
+expect "<^?>"
+recho `echo \7f`
+
+expect "bar"
+recho ${foo:-"`echo bar`"}
+expect "<^A>"
+recho ${foo:-"`echo \ 1`"}
+expect "<^?>"
+recho ${foo:-"`echo \7f`"}
+
+expect "<^A>"
+recho "`echo \ 1`"
+expect "<^?>"
+recho "`echo \7f`"
 
 # Test null strings without variable expansion
 expect "<abcdefgh>"
@@ -89,16 +101,16 @@ unset xxx yyy
 # Test the unquoted special quoting characters
 expect "<^A>"
 recho \ 1
-expect "<^B>"
-recho \ 2
+expect "<^?>"
+recho \7f
 expect "<^A>"
 recho "\ 1"
-expect "<^B>"
-recho "\ 2"
+expect "<^?>"
+recho "\7f"
 expect "<^A>"
 recho '\ 1'
-expect "<^B>"
-recho '\ 2'
+expect "<^?>"
+recho '\7f'
 
 # Test expansion of a variable that is unset
 expect nothing
@@ -139,9 +151,9 @@ expect '<a> <b>'
 FOO=`echo 'a b' | tr ' ' '\012'`
 recho $FOO
 
-# This should give argv[1] = ^A argv[2] = ^B
-expect '<^A> <^B>'
-FOO=`echo '\ 1 \ 2' | tr ' ' '\012'`
+# This should give argv[1] = ^A argv[2] = ^?
+expect '<^A> <^?>'
+FOO=`echo '\ 1 \7f' | tr ' ' '\012'`
 recho $FOO
 
 # Test quoted and unquoted globbing characters
@@ -153,14 +165,14 @@ recho "\.\./*/"
 
 # Test patterns that come up when the shell quotes funny character
 # combinations
-expect '<^A^B^A^B>'
-recho '\ 1\ 2\ 1\ 2'
+expect '<^A^?^A^?>'
+recho '\ 1\7f\ 1\7f'
 expect '<^A^A>'
 recho '\ 1\ 1'
-expect '<^A^B>'
-recho '\ 1\ 2'
-expect '<^A^A^B>'
-recho '\ 1\ 1\ 2'
+expect '<^A^?>'
+recho '\ 1\7f'
+expect '<^A^A^?>'
+recho '\ 1\ 1\7f'
 
 # More tests of "$@"
 set abc def ghi jkl
@@ -384,3 +396,12 @@ ${THIS_SH} ./exp1.sub
 ${THIS_SH} ./exp2.sub
 
 ${THIS_SH} ./exp3.sub
+
+${THIS_SH} ./exp4.sub
+
+${THIS_SH} ./exp5.sub
+
+${THIS_SH} ./exp6.sub
+${THIS_SH} ./exp7.sub
+${THIS_SH} ./exp8.sub
+${THIS_SH} ./exp9.sub