diff options
| author | Jari Aalto <jari.aalto@cante.net> | 1997-06-05 14:59:13 +0000 |
|---|---|---|
| committer | Jari Aalto <jari.aalto@cante.net> | 2009-09-12 16:46:50 +0000 |
| commit | d166f048818e10cf3799aa24a174fb22835f1acc (patch) | |
| tree | 1ca27f9243900f8b236d0cde6a3862002aea9e19 /tests/tilde-tests | |
| parent | ccc6cda312fea9f0468ee65b8f368e9653e1380b (diff) | |
| download | android_external_bash-d166f048818e10cf3799aa24a174fb22835f1acc.tar.gz android_external_bash-d166f048818e10cf3799aa24a174fb22835f1acc.tar.bz2 android_external_bash-d166f048818e10cf3799aa24a174fb22835f1acc.zip | |
Imported from ../bash-2.01.tar.gz.
Diffstat (limited to 'tests/tilde-tests')
| -rw-r--r-- | tests/tilde-tests | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/tilde-tests b/tests/tilde-tests index f0acd55..f5f5309 100644 --- a/tests/tilde-tests +++ b/tests/tilde-tests @@ -1,3 +1,9 @@ +# this is needed because posix mode restricts tilde expansion to assignment +# statements preceding a command, instead of the default of expanding all +# assignment statements on the line (e.g., after `export'). Without this, +# the next-to-last test fails +set +o posix + HOME=/usr/xyz SHELL=~/bash echo ~ch\et @@ -33,7 +39,28 @@ echo "$PPATH" # yes tilde expansion export PPATH=$XPATH:~/bin echo "$PPATH" +declare -x PPATH=$XPATH:~/bin +echo "$PPATH" # no tilde expansion export PPATH="$XPATH:~/bin" echo "$PPATH" +declare -x PPATH="$XPATH:~/bin" +echo "$PPATH" + +# more tests of tilde expansion when executing case commands +case ~ in +$HOME) echo ok 1;; +*) echo bad 1 ;; +esac + +case ~ in +~) echo ok 2 ;; +\~) echo bad 2a ;; +*) echo bad 2b ;; +esac + +case $unset in +"") echo ok 3 ;; +*) echo bad 3 ;; +esac |
