From ab7af98dede422fbaf3b691e4c44e1e76e2fb18c Mon Sep 17 00:00:00 2001 From: David Adam Date: Sat, 25 Oct 2014 13:58:52 +0800 Subject: expand: expand tilde to canonical paths Work on #1133. --- tests/expansion.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/expansion.in b/tests/expansion.in index a2225127..34662d48 100644 --- a/tests/expansion.in +++ b/tests/expansion.in @@ -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 -- cgit v1.2.3