expand: expand tilde to canonical paths

Work on #1133.
This commit is contained in:
David Adam
2014-10-25 13:58:52 +08:00
parent b0e09303a6
commit ab7af98ded
2 changed files with 21 additions and 3 deletions

View File

@@ -80,3 +80,15 @@ echo $foo[d]
echo ()[1]
echo ()[d]
# Test tilde expansion
set tmpdir (mktemp -d)
mkdir $tmpdir/realhome
ln -s $tmpdir/realhome $tmpdir/linkhome
set expandedtilde (env HOME=$tmpdir/linkhome ../fish -c 'echo ~')
if test $expandedtilde != $tmpdir/realhome
echo '~ expands to' $expandedtilde ' - expected ' $tmpdir/realhome
end
unlink $tmpdir/linkhome
rmdir $tmpdir/realhome
rmdir $tmpdir