X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tests%2Ftilde-tests;h=f5f5309023d5bc185a08e9fbded6423aa04caad0;hb=d166f048818e10cf3799aa24a174fb22835f1acc;hp=f0acd5581fea38e2a94b4b696dd0bb831207bcb8;hpb=ccc6cda312fea9f0468ee65b8f368e9653e1380b;p=platform%2Fupstream%2Fbash.git 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